In this article i will show you how to install Portainer CE in Ubuntu Server 22.04 or newer with just a few command lines.
Why would you want to install Portainer when you have Docker Desktop for Ubuntu?
Well, Docker Desktop is somewhat alright if you have a desktop interface running in your Ubuntu installation, but if you are running Ubuntu server or Ubuntu CLI (without a GUI) Docker Desktop wont help you.
Here come Portainer!
It helps you manage containers via a GUI that’s super useful in my opinion to have.
Requirements for Portainer
- latest version of Docker installed on Ubuntu/Ubuntu Server LTS (it will work also on other versions)
- all the packages must be updated to the latest version
How to Install Portainer CE in Ubuntu/Ubuntu Server 22.04 (or newer)
First me need to create a volume where Portainer wills tore all its data.
sudo docker volume create portainer_data
After that you need to pull the latest Portainer Server image and then install it into Docker with the following command.
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
To check if Portainer CE was installed correctly and if its running type:
sudo docker ps
You will see all the containers that are currently running into Docker and in that list it should be Portainer also.
Now in order to login into Portainer enter the following URL in your browser:
https://YOURSERVERSIP:9443