Set up a Linux build environment
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.
Dependencies
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.
Node.JS is a JavaScript package used when building applications that leverage networking, such as Portainer. Version 18 or later is required.
Golang is the open source language that we use to build the majority of Portainer software. Version 1.18 of Golang is required.
Wget is a package used to retrieve files using common internet protocols such as HTTP and FTP.
Part 1: Installing Docker
Step 1: Configure the Docker repository
First, update your system's packages using this command:
Next, install the required packages to use repos over HTTPS:
Now install the official GPG key for Docker:
Use this fingerprint to confirm that you have the correct key:
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
The correct output should be:
And finally, use the following command to set up the stable repository:
Step 2: Install Docker
First, update your system's packages using this command:
Next, install Docker and its associated packages:
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.
Part 2: Installing Yarn
Run this command in the terminal to configure the Yarn repository on your system:
Update your system's packages and install Yarn using this command:
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
First, install or update to the latest version of Node.JS by running this command in the terminal:
Finally, check if Node is installed on your system:
The latest version of Node.JS should now print out.
Part 4: Installing Golang using a Linux tar file
First, download the appropriate version of Go for your system. Navigate to where it was downloaded then extract it to the /usr/local
directory using this command:
Next, add /usr/local/go/bin
to the PATH environment variable inside your shell profile. Here's an example using bash:
And finally, follow the Test your installation section in Golang's official documentation to ensure that Go installed correctly.
Part 5: Installing Wget
To install Wget on Linux, simply run the apt-get install wget
command in the terminal.
Was this helpful?