Portainer is an open-source tool for managing Docker containers. It provides a user-friendly interface for creating and managing containers, as well as monitoring resources and logs.
Step 1: Install Docker
Before installing Portainer, you need to have Docker installed on your VPS. If you don’t have Docker installed yet, you can follow these steps to install it:
Update the package index on your VPS:
sudo apt-get update
Install the necessary packages to allow your system to use repositories over HTTPS:
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
Add the official Docker GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Verify that the key has been added successfully:
sudo apt-key fingerprint 0EBFCD88
Add the Docker repository to your system:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Update the package index again:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Verify that Docker is installed correctly:
sudo docker run hello-world
Step 2: Install Portainer
Now that Docker is installed, you can proceed with installing Portainer. Follow these steps:
Create a Docker volume to store Portainer data:
sudo docker volume create portainer_data
Start the Portainer container:
sudo docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
The above command will download the latest version of Portainer and start it in a Docker container. Portainer will be accessible at http://<your-vps-ip>:9000.
Open a web browser and navigate to http://<your-vps-ip>:9000. You will be prompted to create an administrative account.
Choose a username and password and click Create user.
On the next screen, choose the Local option to manage the local Docker environment.
You will be taken to the Portainer dashboard, where you can start managing your Docker containers.
And that’s it! You now have Portainer installed on your VPS, and you can start using it to manage your Docker containers.
In conclusion, Portainer is a powerful and user-friendly tool for managing Docker containers. By following the steps above, you can easily install Portainer on your VPS and start managing your Docker containers with ease.