How To Set up Portainer on Ubuntu 22.04

This guide intends to teach you to Set up Portainer Container Management Tool on Ubuntu 22.04.

Portainer is a universal container management tool that can work with both Docker and Kubernetes to make the deployment and management of containerized applications and services easier and more efficient. 

Steps To Set up Portainer on Ubuntu 22.04

To install Portainer, you need some requirements, then, follow the rest of the article to complete this guide.

Requirements

You must log in to your server as a root or non-root user with sudo privileges. To do this, you can follow this guide on Initial Server Setup with Ubuntu 22.04.

Then, you must have Docker installed on your server. To do this, you can follow our guide on Install and Use Docker on Ubuntu 22.04.

Also, you must have Docker Compose installed on your server. For this purpose, you can visit this guide on Install and Use Docker Compose on Ubuntu 22.04.

Install Portainer on Ubuntu 22.04

At this point, you can start to install Portainer container management on your server.

Create Docker Volume For Portainer

First, you need to create a volume to store Portainer data. Docker volumes are file systems mounted on Docker containers to preserve data generated by the running container. To do this, run the command below:

docker volume create data

Then, verify it by using the command below:

docker volume ls
Output
DRIVER    VOLUME NAME
local     data

Download and Run Portainer Docker Image

Now you can use the following command to download and run the Portainer docker image:

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v data:/data portainer/portainer
Output
latest: Pulling from portainer/portainer
772227786281: Pull complete
96fd13befc87: Pull complete
0bad1d247b5b: Pull complete
b5d1b01b1d39: Pull complete
Digest: sha256:47b064434edf437badf7337e516e07f64477485c8ecc663ddabbe824b20c672d
Status: Downloaded newer image for portainer/portainer:latest
93c8190fe97d1ae952bbabddb98cb2eebcbd7bd476fadb9781745c800c9108ee

Next, check your Portainer status with the following command:

docker ps
Output
CONTAINER ID   IMAGE                 COMMAND        CREATED              STATUS                    PORTS                                                                                                        NAMES
93c8190fe97d   portainer/portainer   "/portainer"   About a minute ago   Up Abou            t a minute   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9000->9000/tcp,             :::9000->9000/tcp, 9443/tcp   portainer

Access Portainer Web Interface on Ubuntu 22.04

At this point, your Portainer is running on port 9000. You can access it through the web interface by typing your server’s IP address in your web browser followed by 9000:

http://your-server-ip:9000

In the first screen, you should create the initial administrator user.

Portainer administrator user

Then, you will see your Portainer dashboard.

Portainer dashboard ubuntu 22

You can now easily host your application on the containerization platform via a web-based interface. 

Conclusion

At this point, you have earned to Set up the Portainer Container Management Tool on Ubuntu 22.04.

Hope you enjoy it. You may be interested in these articles:

Install GitHub Desktop on Ubuntu 22.04

Install and Use Flatpak on Ubuntu 22.04

Set up Postfix Mail Server on Ubuntu 20.04

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!