githubEdit

Set up a macOS 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 Mac so you can build your own copy of Portainer and test your changes.

circle-info

We tested these instructions on macOS 10.14.3 (Mojave).

Dependencies

  • Docker for Macarrow-up-right installs the Docker application and other Docker tools. 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.

  • Yarnarrow-up-right is a package manager for installing new software packages on your system, and is used to run the Portainer development environment.

  • Node.JSarrow-up-right is a JavaScript package used when building applications that leverage networking, such as Portainer. Version 18 or later is required.

  • Golangarrow-up-right 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 for macOS

circle-exclamation

Step 1: Install Docker

circle-info

We always recommend installing software using the most up-to-date instructions from the official vendor. This step is based on Docker's own installation instructions for Docker on macOSarrow-up-right.

Download Dockerarrow-up-right then navigate to the Docker.dmg file and double-click to open. Drag and drop Docker into your applications folder. Authorize the installation using your system password then wait for Docker to finish installing.

To check that Docker installed successfully, double-click Docker inside your applications folder to start it. The whale icon should appear in your status bar, indicating Docker is running and accessible.

Step 2: Check the installed Docker version

Click the Docker icon in the status bar then select About Docker Desktop from the menu (or a similarly named menu item, depending on your Docker version). A window should open, displaying the current version of Docker and its supporting software.

Part 2: Installing Yarn

circle-info

This procedure uses the Homebrew package manager. Go herearrow-up-right to learn how install it. If you don't want to use Homebrew, Yarn provides some alternativesarrow-up-right.

circle-info

If you have issues installing or using Yarn, read their official documentationarrow-up-right.

Running brew install yarn in the macOS terminal will install Yarn. To confirm it installed successfully, run yarn --version in the macOS terminal.

If successful, the current version of Yarn should print out in your terminal, indicating that it installed successfully and is running on your system.

Part 3: Installing or updating Node.JS

circle-info

If you used Homebrew to install Yarn, Node.JS should have automatically installed alongside it. If not, you can install it by following the Node.JS documentationarrow-up-right.

circle-info

If you have issues installing or updating Node.JS using Homebrew, read Homebrew's troubleshooting guidearrow-up-right.

To check if Node.JS is installed on your system, run node --version in your terminal. The current version of Node.JS should print out. If the version is version 6 or later, updating it to the latest version is optional (but we recommend it because it's good practice to stay up to date).

If you are running a version of Node.JS that is older than version 6, you must upgrade in order to run the Portainer development environment.

If Homebrew was installed at the same time as Yarn (using Homebrew), follow these steps to update Node.JS:

Was this helpful?