Self Hosted Docker & Portainer on Ubuntu

Self Hosted Docker & Portainer on Ubuntu
Photo by Ian Taylor / Unsplash

Docker containers and the Portainer administration interface is at the core of Formable setups. Once you have an Ubuntu 22 server deployed (yes Formable does all this for you), SSH into your server and run the following commands to install Docker and then Portainer.

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
docker volume create portainer_data
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:2.9.3

Portainer screencast on how to manage containers on formable.app

Now that the installation is complete, you can log into your Portainer Server instance by opening a web browser and going to: https://youripordomain:9443

With Formable your instance is available at https://portainer.yourdomain.com

Mastodon