Blog / Tutorials

How to Install Portainer on Ubuntu & Debian VPS

6 min read
How to Install Portainer on Ubuntu & Debian VPS

Introduction

Docker is an amazing tool, but typing commands into a black terminal can be overwhelming for beginners. Enter Portainer - a graphical user interface (GUI) dashboard that lets you click your way through Docker straight from your web browser.

In this step-by-step tutorial, we will show you how to install Portainer on your server in just a few minutes. You don't need to be a Linux expert - just copy and paste the commands below!

Prerequisites: You will need a Premium VPS running Ubuntu or Debian and an SSH client (e.g. PuTTY or your system Terminal). If you don't have a server yet, VoxiHost offers Premium VPS and Budget VPS with Ubuntu and Debian available out of the box.


Step 1: Connect to your Server and Install Docker

First, connect to your server via SSH. Next, let's make sure Docker is installed. If you don't have it yet, simply paste this one-line installer command which will do all the heavy lifting for you:

Terminal showing the Docker installation process on Ubuntu

curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh

Wait a few moments for the installation to finish.


Step 2: Prepare Storage for Portainer

Portainer needs a safe place on your hard drive to save your passwords and configurations. Paste the following command into your terminal and press ENTER to create a "volume":

Creating a Docker volume for Portainer in the terminal

docker volume create portainer_data

Step 3: Run Portainer

Now we will start Portainer itself. The command below will download the latest version and run it in the background. Paste the entire command into the terminal and press ENTER:

Running the Portainer CE container with required port and volume parameters

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

That's it! The installation on the server side is complete.


Step 4: First Login in the Browser

You can now close your terminal. Open your favorite web browser (like Chrome or Firefox) and type the following into the address bar:

https://YOUR_SERVER_IP:9443
(Replace "YOUR_SERVER_IP" with the actual IP address of your VPS, e.g., https://192.168.1.50:9443)

Tip: If you see the error Client sent an HTTP request to an HTTPS server., it means your browser tried to connect via standard HTTP. Make sure your address explicitly starts with https://.

Important: Your browser might show a "Your connection is not private" warning. This is completely normal because the server uses a self-signed certificate by default. Simply click "Advanced" and then "Proceed / Continue".

You will see the initial setup screen. Create a strong password for yourself, type it twice, and click the Create user button.

Important (5-minute limit!): Portainer takes security seriously. If more than 5 minutes pass between starting the container (Step 3) and setting your password, the setup will time out. To unlock it, go to your terminal and type docker restart portainer, then refresh the page. You will then be asked for a Setup Token. To get it, type docker logs portainer. Near the bottom of the logs, you will see Use the following token to setup the administrator user: followed by a long code. Copy this token and paste it into the browser.

Portainer initial admin account setup screen in the browser


Step 5: Managing Containers

After logging in, click the "Get Started" button, and on the next screen, click the whale icon labeled "Local" (which represents the server we are currently on).

You're all set! You now have access to the full dashboard. From now on, you don't need to use terminal commands - you can manage your apps using your mouse.

Portainer main dashboard showing a list of active Docker containers


Conclusion

Portainer is an incredible tool that makes Docker accessible even for those without much Linux experience. If you are looking for a server to run your own projects, VoxiHost offers Premium VPS and Budget VPS with Ubuntu and Debian ready to go.

Frequently Asked Questions

Portainer CE (Community Edition) is free and open-source - it covers all core Docker management features. Portainer Business Edition (BE) adds enterprise features such as role-based access control (RBAC), OAuth/LDAP integration, and extended support.
Portainer uses HTTPS on port 9443, but exposing it publicly is not recommended without additional protection. Consider placing it behind a reverse proxy (e.g. Nginx Proxy Manager) with authentication, or restricting access to trusted IP addresses via your firewall.
Stop and remove the existing container, then pull the latest image and run the same docker run command again. Your data is preserved in the portainer_data volume: docker stop portainer && docker rm portainer, then re-run the original install command.
Yes. Portainer calls them Stacks. You can deploy and manage Docker Compose files directly from the Portainer web UI without touching the terminal.
You need to reset the password via the command line. Stop the container, run docker run --rm -v portainer_data:/data portainer/helper-reset-password, copy the generated password, then restart Portainer with docker start portainer.

Suggest Edits on GitHub

Spot a typo or want to improve this guide? This post is open-source and open for community contributions.

Edit this post
Back to all posts

Languages