Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host Portainer on a VPS (Complete Guide)

Learn how to self-host Portainer on a VPS with a step-by-step 2026 guide covering install, configuration, and securing Portainer for reliable daily use.

How to Self-Host Portainer on a VPS (Complete Guide)

Portainer is an essential tool for developers and homelab enthusiasts looking to manage Docker containers efficiently. This guide outlines the steps to self-host Portainer on a VPS, enabling you to take full control of your containerized applications. Weโ€™ll go over installation, configuration, and troubleshooting, ensuring you have a seamless experience.

Why Self-Host Portainer?

Self-hosting Portainer provides several advantages:

Prerequisites

Before we start with the installation process, make sure you have:

  1. A VPS with at least 1 GB of RAM.
  2. Docker installed.
  3. SSH access to your VPS.

Here are some good VPS options to consider:

ProviderPrice per MonthFeatures
Contabo VPS5.99 EURSSD storage, great performance
Hetzner Cloud4.15 EURFlexible configurations, reliable uptime
DigitalOcean6 USDGlobal data centers, easy to use management tools
Vultr6 USDHigh-performance SSD, affordable options
Linode (Akamai Cloud)5 USDSimple pricing, robust performance

For a full VPS comparison, check out our best VPS comparison page.

Step 1: Connecting to Your VPS

Use SSH to connect to your VPS. Replace your_user and your_ip with your actual username and IP address.

ssh your_user@your_ip

Step 2: Install Docker

Portainer runs as a container in Docker. Hereโ€™s how to install Docker on your VPS:

For Ubuntu/Debian

sudo apt update
sudo apt install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker

For CentOS

sudo yum update
sudo yum install -y docker
sudo systemctl start docker
sudo systemctl enable docker

Make sure Docker is installed properly by checking its version:

docker --version

Step 3: Deploying Portainer

Now that Docker is installed, you can run Portainer. Use the following command to deploy Portainer in a Docker container:

docker run -d -p 9000:9000 --name portainer \
--restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
portainer/portainer-ce

Explanation of the Docker Command

Step 4: Accessing Portainer

Once deployed, access Portainer by navigating to http://your_ip:9000 in your web browser. The initial setup will prompt you to create an admin user and password.

Step 5: Configure Portainer

After logging in, you will need to connect Portainer to your Docker environment. Hereโ€™s how to do it:

  1. Choose โ€œLocalโ€ as your environment.
  2. Continue to the dashboard, where you can manage your containers, networks, and volumes.

Frequently Asked Questions

How do I update Portainer?

Updating Portainer is straightforward. To pull the latest version, just stop the existing container and remove it, then run the latest image. Hereโ€™s how:

docker stop portainer
docker rm portainer
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer-ce

This process ensures you have the latest features and security fix. Always ensure your data is backed up before performing updates.

Can I use a domain name with Portainer?

Yes, you can use a domain name to access Portainer. To do this, youโ€™ll need to set up a DNS record that points your domain to your VPSโ€™s IP address. After that, you can use a reverse proxy like Nginx or Traefik to handle the domain requests. This configuration not only improves usability but also adds a layer of security through SSL/TLS.

Is it secure to self-host Portainer on a VPS?

While self-hosting Portainer can be secure, it depends on your setup. Always implement the following practices:

  1. Use strong passwords for your admin account.
  2. Enable HTTPS, ideally with a valid SSL certificate.
  3. Monitor access logs and configure firewall rules to limit access to specific IPs if possible.

By taking these precautions, you can significantly reduce the risk associated with self-hosting Portainer.

Conclusion

Self-hosting Portainer on a VPS is an efficient way to manage your Docker containers. By following the steps outlined in this guide, youโ€™ll gain not just hands-on experience but also a robust solution for managing your containerized applications. Donโ€™t hesitate to explore community resources like r/selfhosted and awesome-selfhosted for more insights and tools to enhance your setup.