To install Portainer on your VPS running Ubuntu, follow these steps:
Update the system:
sudo apt-get update && sudo apt-get upgrade
Install Docker: Portainer requires Docker to run. If Docker is not already installed, you can install it with:
sudo apt-get install docker.io
Pull the Portainer image: Download the Portainer Community Edition Docker image:
docker pull portainer/portainer-ce
Create a volume for Portainer data: This ensures that Portainer's data persists:
docker volume create portainer_data
Run the Portainer container: Start the Portainer container with the following command:
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
Access the Portainer web interface: Open your browser and navigate to your server https://your-server:9443/ . You'll be prompted to set up an admin user and password.