October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Install Portainer CE on Ubuntu 26.04 Without Exposing Your Docker Host

Install Portainer CE on Ubuntu 26.04 with Docker Engine, bind the web interface to trusted addresses, and understand why the Docker socket mount is a control decision, not just a network one.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can run Portainer CE on Ubuntu 26.04 with its web interface reachable only from your own network. The standard installation, however, mounts the Docker socket into the Portainer container, which means Portainer can control the Docker daemon on that host. Keeping the interface off the public internet is one part of the job. Limiting who can reach Portainer and who can log in to it is the other.

What “without exposing the Docker host” actually means

The phrase covers two different risks, and the install steps address them differently.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Network exposure. Portainer’s web interface listens on a port on the host. If that port is reachable from the internet, anyone who can reach it can attempt to log in. Binding the port to a private address, or filtering it, reduces this risk.
  • Control exposure. Portainer’s documented local deployment mounts /var/run/docker.sock into the container. That socket is the control interface for the Docker daemon. Anyone who gets into Portainer with administrator rights can start containers, mount host paths, and act with root-level effect on the host. Network restrictions do not change this. The socket mount is a trust decision, not a network setting.

The rest of this guide covers the simple local deployment that Portainer documents, then shows how to narrow the network side, and finally explains what the socket mount means for access control.

Prerequisites

  • Ubuntu 26.04 LTS, with a user that has sudo access.
  • A working Docker Engine installation. Portainer’s documentation recommends Docker’s official installation instructions and advises against installing Docker through Snap on Ubuntu because compatibility problems can occur.
  • A decision about who will reach the Portainer interface: a single administrator on the host, or a small set of clients on a private network.

Ubuntu 26.04 LTS is supported until April 2031, according to the Ubuntu 26.04 LTS release notes in Ubuntu Documentation.

Step 1: Install Docker Engine from Docker’s repository

Docker’s “Install Docker Engine on Ubuntu” guide lists Ubuntu Resolute (26.04 LTS) among its supported releases, alongside Noble (24.04 LTS) and Jammy (22.04 LTS). Use the current guide rather than older snippets that hard-code a previous codename. Its repository setup reads the codename from /etc/os-release, and the key and package steps can change between releases.

Before installing the official packages, remove any conflicting unofficial packages. The Docker guide names these: docker.io, docker-compose, docker-compose-v2, docker-doc, docker-buildx, podman-docker, containerd, and runc. Then confirm the Docker service is running and run the test container described in the same guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Docker’s guide lists supported architectures as x86_64/amd64, armhf, arm64, s390x, and ppc64le/ppc64el. If your host is one of the others, check the guide before you continue.

Step 2: Deploy Portainer CE

Portainer’s documented Docker run command creates a named volume for its data, then starts the container with the socket and data mounts:

docker volume create portainer_data
docker run -d 
  --name portainer 
  --restart=always 
  -p 9443:9443 
  -v /var/run/docker.sock:/var/run/docker.sock 
  -v portainer_data:/data 
  portainer/portainer-ce:lts

Portainer’s examples have used more than one image tag. Its Compose example and current update guidance use lts, while one Linux installation example uses sts. Before you copy the command, check the official Portainer installation page for the channel you want, because tags move over time.

The named volume portainer_data keeps Portainer’s configuration when you replace the container. Portainer’s Compose example uses the same socket and data mounts and publishes port 9443. Use whichever form fits how you manage your host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Confirm that the container is up:

docker ps

On the host itself, open https://localhost:9443. Portainer generates a self-signed certificate by default, so your browser will show a warning on first use. Portainer’s documentation lets you supply your own certificate during installation or later from the web interface. Replace the self-signed certificate if clients outside the host will connect.

Step 3: Limit the network side

Publish only the ports you need

Portainer’s documentation describes the following ports. Only 9443 is needed for the standard web interface.

Port Purpose When to publish it
9443/TCP HTTPS web interface Required for the standard interface
8000/TCP Edge Agent communication Only if you use Edge Agent features; otherwise omit -p 8000:8000
9000/TCP Legacy HTTP interface Not needed by default; publish only for a specific legacy HTTP requirement
9001/TCP Portainer Agent on a Docker Standalone host Only when a remote Portainer Server connects to this host through the standalone Agent

Restrict who can reach 9443

The sample command binds 9443 on all host addresses, because -p 9443:9443 does not specify an address. If only local administration is needed, bind the port to the loopback address instead:

-p 127.0.0.1:9443:9443

With that binding, reach Portainer from another machine through an SSH tunnel, for example ssh -L 9443:localhost:9443 user@your-host, rather than opening the port. If other clients on a private network must connect directly, bind to that network’s address and allow only the source addresses you intend.

Do not rely on ufw or firewalld alone

Docker’s guide warns that ports published by containers bypass ufw and firewalld rules. A host firewall rule that blocks 9443 may not stop traffic to a port Docker has published. Use a binding such as the loopback address above, or configure filtering in a way you have confirmed works with Docker on your host. Then test from a machine outside your network. A rule that looks correct on the host is not evidence that the port is closed.

Choose who can log in, and who can use the socket

Treat every Portainer administrator as an operator of the Docker host. Docker’s post-installation documentation states that users in the docker group have root-level privileges. Portainer’s access to the socket gives it similar reach, whichever user logs in to the interface. Give administrator roles only to people who need them, use strong unique passwords, and keep the interface reachable only from clients you trust.

Making the socket mount read-only is not a complete fix. Portainer still needs to change the daemon’s state to manage containers, so a read-only mount does not turn the arrangement into a limited one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Managing a separate Docker host with an Agent

If Portainer Server runs on a different machine from the Docker host you want to manage, Portainer’s documentation describes connecting a Docker Standalone environment through an Agent, a direct API connection, the socket, or an Edge Agent. The choice changes the trust boundary.

  • Standalone Agent. The Server must reach the Agent on TCP 9001, and Server-to-Agent communication uses HTTPS. Portainer describes this as a legacy option that does not provide Edge features or policy management. Restrict 9001 to the Server’s address.
  • Edge Agent. Portainer documents Edge features on TCP 8000. Check the current Edge documentation before choosing this path for a production host.

An Agent does not make the managed host safer by default. It still runs with access to the Docker daemon on that host, and its network path needs the same controls described above. Portainer’s host setup documentation also describes host-management features that can browse the host filesystem when the Agent has the host root mounted at /host. Those features are disabled by default. Leave them disabled unless you need them.

Verify the setup

  • Run docker ps and confirm that the portainer container is running with only the ports you intended.
  • From the host, load https://localhost:9443 and create the administrator account.
  • From an outside network, confirm that 9443 does not respond. If it does, revisit the port binding and firewall configuration.
  • From an authorized client, confirm that the certificate is trusted, or that you understand the browser warning.

If the Portainer container fails to start, check docker logs portainer first. If the interface loads but Portainer cannot list containers, check that the socket path in your run command matches /var/run/docker.sock on the host.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.