Docker Setup
Note
Installation instructions sourced from Docker's official site.
Add Docker's apt repository:
Add the repository to APT sources:echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Install the Docker packages:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Verify that the Docker Engine installation is successful by running the hello-world image:
You have now successfully installed and started Docker Engine.
Remove the hello-world container by running:
Install Portainer CE
Note
Installation instructions sourced from Portainer's official documentation.
I like to run Portainer to manage all of my containers.
First, create the volume that Portainer Server will use to store its database:
Then, download and install the Portainer Server container:
sudo docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Portainer Server has now been installed. You can check to see whether the Portainer Server container has started by running:
Now that the installation is complete, you can log into your Portainer Server instance by opening a web browser and going to:
You will then be required to set up for the first time and create a new user. You can also check or uncheck the box allowing Portainer to collect anonymous statistics.
Managing Additional Docker Hosts
Once you have set up your docker environment, you may wish to have more than one Docker server and manage those from the same interface.
I currently have 3 servers running Docker that are seperated by roles:
- plex: runs all of my media server content
- docker: runs anything not related to media
- tdarr: specifically runs tdarr on this host
This can be done by:
- Installing Ubuntu on another server.
- Installing Docker as described above.
- Installing the Portainer agent on the new server.
You can add the docker host by logging into you Portainer web interface and navigating to Environments and clicking on "+ Add environment":
From here you can click on "Docker Standalone" and "Start Wizard":
In the Environment Wizard, select "Agent". Give the new environment a name, and provide the address of the new Docker server with port 9001.
You can then copy the docker run command and run it on your new Docker server. Once the container has finished installing on the new server, click the "Connect" button in the Wizard.
The new server will be added as a new "Environment" and can be managed from the same Portainer web interface.