Installing Portainer in Ubuntu Server

February 25, 2023
Installing portainer in ubuntu server 

So you got a flashy new ubuntu server. Here are the steps to install portainer on it so that we can start experimenting with other stuffs. 

You would obviously need docker , Puttin in docker compose here just for future use.
sudo apt-get install docker docker-compose 

Add user into the docker group.
sudo usermod -aG docker xecutioner

Create a volume, Volumes can be considered as virtual storage drives for docker. 
docker volume create portainer_data

Run 
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
Notice ports 8000 and 9000 , to be used for http and https respectively. 

Check if portainer container is running. 
docker ps

Visit : https://YOUR_IP_HERE:9443
You should be greeted with a change password screen. 
After you have set up your new password. 
You would need to restart the container. Use this command. 
sudo docker restart portainer

That is it, I use portainer to host variety of stuffs in my homelab.