As an open source product, we encourage users to edit our code and submit patches to it. This article explains how to set up a local environment on Linux so you can build your own copy of Portainer and test your changes.
We tested these instructions on Ubuntu 18.04.2 LTS. For instructions that relate to other systems, see the linked documentation below.
Docker CE is the Docker application that runs on your machine to enable the use of Docker features. The latest version is not a requirement for this development stack, however we recommend staying up to date with the latest improvements and security fixes.
Yarn is a package manager for installing new software packages on your system, and is used to run the Portainer development environment.
Golang is the open source language that we use to build the majority of Portainer software. Version 1.17 of Golang is required.
Wget is a package used to retrieve files using common internet protocols such as HTTP and FTP.
Finally, verify that Docker was correctly installed and is running on your system. This command should download a test image that you can run in a container, print an informational message for then exit out of.
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
Update your system's packages and install Yarn using this command:
sudo apt-get update && sudo apt-get install yarn
Finally, run this command in the terminal to confirm that the Yarn installation was a success:
The current version of Yarn should print out in your terminal, indicating that that it installed successfully and is running on your system.
Part 3: Installing or updating Node.JS
This procedure makes use of NVM to install Node.JS (Node.JS version 12 or later is required). NVM allows multiple different versions of Node.JS to be installed on a system and provides an easy way to switch between them.
If you have issues installing or updating Node.JS, read NVM's documentation.
First, install or update to the latest version of Node.JS by running this command in the terminal:
nvm install node
Finally, check if Node is installed on your system:
The latest version of Node.JS should now print out.