{"id":1089,"date":"2026-11-15T09:00:00","date_gmt":"2026-11-15T09:00:00","guid":{"rendered":"https:\/\/vpslake.com\/blog\/?p=1089"},"modified":"2026-11-15T09:00:00","modified_gmt":"2026-11-15T09:00:00","slug":"install-docker-portainer-debian-11","status":"publish","type":"post","link":"https:\/\/vpslake.com\/blog\/2026\/11\/15\/install-docker-portainer-debian-11\/","title":{"rendered":"How to Install Docker Portainer on Debian 11"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Install docker portainer on Debian 11 and finish with Docker Engine plus a persistent Portainer CE dashboard in about ten minutes. This setup keeps the management UI on the server\u2019s loopback address and reaches it safely through an SSH tunnel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>A 64-bit Debian 11 (Bullseye) VPS with at least 2 GB of RAM and 10 GB of free disk space for images, containers, and Portainer data.<\/li>\n\n\n<li>Root access, or a normal SSH account that can run commands with <code>sudo<\/code>.<\/li>\n\n\n<li>Outbound HTTPS access to Docker\u2019s package repository and Docker Hub.<\/li>\n\n\n<li>An SSH client on your own computer. A domain is not needed for the private tunnel in this guide.<\/li>\n\n\n<li>A <a href=\"https:\/\/vpslake.com\/buy-vps\">VPSLake Linux VPS<\/a> with root access if you need a Debian server for Docker workloads.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Debian 11 is an older Bullseye release. Keep a migration to Debian 12 or 13 on your maintenance plan, especially if Docker stops publishing Bullseye packages for your architecture. The commands below use Bullseye explicitly so APT cannot accidentally select an Ubuntu repository or a different Debian release.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The commands assume a regular sudo-enabled account. If you are logged in as <code>root<\/code>, remove <code>sudo<\/code> from the commands.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Confirm Bullseye and update APT<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Checking the release first prevents a repository for Bookworm, Trixie, or Ubuntu from being added to the wrong system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>. \/etc\/os-release &amp;&amp; printf 'ID=%s\\nVERSION_ID=%s\\nVERSION_CODENAME=%s\\n' \"$ID\" \"$VERSION_ID\" \"$VERSION_CODENAME\"\nuname -m\nsudo apt-get update\nsudo apt-get full-upgrade -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The release should be Debian 11 with the <code>bullseye<\/code> codename, and most VPSs will report <code>x86_64<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ID=debian\nVERSION_ID=\"11\"\nVERSION_CODENAME=bullseye\nx86_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the first command reports another release, stop here and use that release\u2019s Docker instructions. Do not force Bullseye packages onto it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Clear conflicting container packages<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Debian\u2019s <code>docker.io<\/code>, standalone <code>containerd<\/code>, and an older Compose package can conflict with Docker\u2019s Engine packages, so remove only packages that are actually installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\\n' docker.io docker-compose docker-doc docker-buildx podman-docker containerd runc 2&gt;\/dev\/null | awk '$1 ~ \/^ii\/ {print $2}' | xargs -r sudo apt-get remove -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">No output means none of those packages were installed. Removing packages this way does not erase Docker images, containers, or volumes under <code>\/var\/lib\/docker\/<\/code>; do not run a purge on a host that already runs important workloads without a backup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Add Docker\u2019s signed Debian repository<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Docker\u2019s repository supplies Docker Engine, its CLI, containerd.io, Buildx, and the Compose plugin as a coordinated set. The key is stored in APT\u2019s per-repository keyring instead of the deprecated global <code>apt-key<\/code> store.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install -y ca-certificates curl\nsudo install -m 0755 -d \/etc\/apt\/keyrings\nsudo curl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg -o \/etc\/apt\/keyrings\/docker.asc\nsudo chmod a+r \/etc\/apt\/keyrings\/docker.asc\necho \"deb [arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/debian bullseye stable\" | sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null\nsudo apt-get update<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that APT sees Docker packages before installing them:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-cache policy docker-ce | sed -n '1,8p'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output should show a candidate version from <code>download.docker.com<\/code>. If APT says the Bullseye repository has no Release file, do not substitute an Ubuntu URL; see the first troubleshooting entry and upgrade the VPS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Install and test Docker Engine<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Installing the Compose plugin now gives you the <code>docker compose<\/code> command for future application stacks managed from Portainer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\nsudo systemctl enable --now docker\nsudo systemctl is-active docker\nsudo systemctl is-enabled docker\nsudo docker version --format 'Client {{.Client.Version}} \/ Server {{.Server.Version}}'\nsudo docker compose version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected output has an active, enabled service; version numbers vary as Docker publishes updates:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>active\nenabled\nClient &lt;version&gt; \/ Server &lt;version&gt;\nDocker Compose version v2.x.y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run Docker\u2019s disposable test image. It checks the daemon, registry access, and container runtime, then removes the stopped test container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker run --rm hello-world<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The final lines should include <code>Hello from Docker!<\/code> and <code>Your installation appears to be working correctly.<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Deploy Portainer CE with private HTTPS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The named volume keeps Portainer\u2019s users, settings, and environment records outside the container, while the loopback binding prevents direct internet access to the dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the volume and start Portainer\u2019s long-term-support image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker volume create portainer_data\nsudo docker run -d \\\n  --name portainer \\\n  --restart=always \\\n  --publish 127.0.0.1:9443:9443 \\\n  --volume \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  --volume portainer_data:\/data \\\n  portainer\/portainer-ce:lts<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Docker prints a container ID. Confirm that the service is running and published only on loopback:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker ps --filter name=portainer --format 'table {{.Names}}\\t{{.Image}}\\t{{.Status}}\\t{{.Ports}}'<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>NAMES      IMAGE                       STATUS      PORTS\nportainer  portainer\/portainer-ce:lts Up ...       127.0.0.1:9443-&gt;9443\/tcp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Portainer\u2019s <a href=\"https:\/\/docs.portainer.io\/start\/install-ce\/server\/docker\/linux\" target=\"_blank\" rel=\"noopener\">official Docker installation guide<\/a> uses port 9443 for HTTPS and the Unix socket for a local Docker environment. Port 8000 is for optional Edge Agent tunnel features, so it is intentionally not published here. Because 9443 is bound to <code>127.0.0.1<\/code>, do not add a public UFW rule for it; keep your existing SSH rule in place.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Open the dashboard through SSH<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An SSH local forward carries your browser\u2019s connection to the private listener without exposing Portainer in the VPS firewall.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run this command on your own computer, not in the VPS shell, and leave the terminal open:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -N -L 9443:127.0.0.1:9443 YOUR_SSH_USER@SERVER_IP<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>YOUR_SSH_USER<\/code> with the VPS login name and <code>SERVER_IP<\/code> with the public VPS address. Browse to <code>https:\/\/127.0.0.1:9443<\/code> on your computer. A certificate warning is expected because the first Portainer container uses a self-signed certificate; continue only if the address is exactly <code>127.0.0.1<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the first administrator promptly, using a unique password of at least 12 characters, then choose the automatically detected local Docker environment. Portainer protects an unconfigured installation by stopping its listener if initial setup is not completed within the startup window.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If local port 9443 is busy, change only the workstation side of the tunnel:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -N -L 19443:127.0.0.1:9443 YOUR_SSH_USER@SERVER_IP<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then open <code>https:\/\/127.0.0.1:19443<\/code>; the VPS-side Portainer port remains 9443.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify Docker and Portainer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run these checks on the VPS to prove that Docker starts at boot, Portainer will restart automatically, the listener is private, and HTTPS answers locally:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl is-active docker\nsudo systemctl is-enabled docker\nsudo docker inspect --format '{{.HostConfig.RestartPolicy.Name}}' portainer\nsudo ss -lntp | grep '127.0.0.1:9443'\ncurl --insecure --silent --show-error --output \/dev\/null --write-out '%{http_code}\\n' https:\/\/127.0.0.1:9443<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected results include:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>active\nenabled\nalways\nLISTEN ... 127.0.0.1:9443 ...\n200<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Refresh the tunneled browser page. You should see Portainer\u2019s login page or dashboard, and the local Docker environment should appear after the first-time wizard completes.<\/p>\n\n\n\n<aside class=\"vl-element vl-cta-banner\" aria-label=\"Run Docker on Debian\">\n\t<div class=\"vl-cta-banner__content\">\n\t\t<p class=\"vl-cta-banner__eyebrow\">Debian VPS Hosting<\/p>\n\t\t<h3 class=\"vl-cta-banner__title\">Run Docker on Debian<\/h3>\n\t\t<p class=\"vl-cta-banner__text\">Deploy Docker and Portainer on a root-access VPS with private HTTPS management.<\/p>\n\t<\/div>\n\t<a class=\"vl-cta-banner__button\" href=\"\/buy-vps\" aria-label=\"View Linux VPS plans\">View Linux VPS plans<\/a>\n<\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><code>does not have a Release file<\/code> for Bullseye<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Docker\u2019s current Debian documentation lists newer Debian releases, and an older Bullseye mirror can disappear as the release ages. Do not point APT at <code>linux\/ubuntu<\/code> or mix Debian releases. Upgrade the VPS to Debian 12 or 13, then follow the matching Docker instructions and use Portainer\u2019s same container command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>permission denied while trying to connect to the Docker daemon socket<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The Docker socket is root-owned, which is why this guide uses <code>sudo<\/code>. Continue using <code>sudo<\/code>, or grant access to one trusted account and reconnect before testing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -aG docker YOUR_SSH_USER<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Membership in the <code>docker<\/code> group is effectively root-level access to the host. Do not add ordinary application users to it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>https:\/\/SERVER_IP:9443<\/code> does not load<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">That URL bypasses the design of this guide: Portainer listens on <code>127.0.0.1<\/code>, not the public interface. Start the SSH tunnel from Step 6 and open <code>https:\/\/127.0.0.1:9443<\/code> locally. Check the binding with <code>sudo ss -lntp | grep '127.0.0.1:9443'<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>Your Portainer instance has timed out for security purposes<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Portainer stops a fresh instance when its first administrator is not created in time. Restart it and complete setup immediately:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker restart portainer<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the container has exited, use <code>sudo docker start portainer<\/code>, then refresh the tunneled page. Keep the <code>portainer_data<\/code> volume mounted; deleting it would remove the stored Portainer configuration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hardening<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>Keep port 9443 on loopback. If you later publish Portainer through a domain, put it behind a reverse proxy with a trusted certificate, strong authentication, and a narrowly scoped firewall rule.<\/li>\n\n\n<li>Treat <code>\/var\/run\/docker.sock<\/code> and the Portainer administrator account as root-equivalent access. Limit SSH and Portainer administration to trusted operators.<\/li>\n\n\n<li>Back up the <code>portainer_data<\/code> volume before changing the image tag or rebuilding the container.<\/li>\n\n\n<li>Use VPSLake\u2019s <a href=\"https:\/\/vpslake.com\/sshd-hardening-generator\">SSH hardening generator<\/a> to review SSH settings before relying on the tunnel for administration.<\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need a domain name to use Portainer on Debian 11?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. The SSH tunnel exposes the private HTTPS listener only to your workstation, so <code>127.0.0.1<\/code> is sufficient. A domain becomes useful only when you deliberately place Portainer behind a public reverse proxy with trusted TLS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is port 8000 required for Portainer CE?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Port 8000 is an optional tunnel used by Portainer Edge Agent features. A Portainer Server managing Docker on the same host through the Unix socket can leave that port unpublished.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I update Portainer without deleting my containers?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Containers are managed by Docker, while Portainer\u2019s own users and settings live in <code>portainer_data<\/code>. Preserve that volume and replace only the Portainer container during a planned update.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Should I keep using Debian 11 for a new Docker VPS?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Prefer Debian 12 or 13 for a new deployment because Bullseye is an aging release and newer Docker packages target newer Debian versions. If you already have Debian 11, schedule an upgrade rather than treating this installation as a long-term substitute for a supported release.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Do I need a domain name to use Portainer on Debian 11?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. The SSH tunnel exposes the private HTTPS listener only to your workstation, so `127.0.0.1` is sufficient. A domain becomes useful only when you deliberately place Portainer behind a public reverse proxy with trusted TLS.\"}}, {\"@type\": \"Question\", \"name\": \"Is port 8000 required for Portainer CE?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. Port 8000 is an optional tunnel used by Portainer Edge Agent features. A Portainer Server managing Docker on the same host through the Unix socket can leave that port unpublished.\"}}, {\"@type\": \"Question\", \"name\": \"Can I update Portainer without deleting my containers?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. Containers are managed by Docker, while Portainer\u2019s own users and settings live in `portainer_data`. Preserve that volume and replace only the Portainer container during a planned update.\"}}, {\"@type\": \"Question\", \"name\": \"Should I keep using Debian 11 for a new Docker VPS?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Prefer Debian 12 or 13 for a new deployment because Bullseye is an aging release and newer Docker packages target newer Debian versions. If you already have Debian 11, schedule an upgrade rather than treating this installation as a long-term substitute for a supported release.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Install docker portainer on Debian 11 with Docker Engine, persistent storage, loopback-only HTTPS, an SSH tunnel, verification, and common fixes.","protected":false},"author":1,"featured_media":1090,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[5,9],"tags":[119,96,118,137],"class_list":["post-1089","post","type-post","status-publish","format-standard","has-post-thumbnail","category-guides","category-vps-hosting","tag-containers","tag-debian-11","tag-docker","tag-portainer","cs-entry"],"_links":{"self":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/comments?post=1089"}],"version-history":[{"count":1,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1089\/revisions"}],"predecessor-version":[{"id":4046,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1089\/revisions\/4046"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media\/1090"}],"wp:attachment":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media?parent=1089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/categories?post=1089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/tags?post=1089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}