{"id":1087,"date":"2026-11-15T03:00:00","date_gmt":"2026-11-15T03:00:00","guid":{"rendered":"https:\/\/vpslake.com\/blog\/?p=1087"},"modified":"2026-11-15T03:00:00","modified_gmt":"2026-11-15T03:00:00","slug":"install-docker-portainer-centos-stream-9","status":"publish","type":"post","link":"https:\/\/vpslake.com\/blog\/2026\/11\/15\/install-docker-portainer-centos-stream-9\/","title":{"rendered":"How to Install Docker Portainer on CentOS Stream 9"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Install Docker Portainer on CentOS Stream 9 and manage local containers from a private HTTPS dashboard in about ten minutes. You will install Docker Engine from Docker\u2019s RPM repository, preserve Portainer\u2019s configuration in a named volume, and access the interface through an SSH tunnel without publishing its admin port.<\/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 CentOS Stream 9 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>SSH access as <code>root<\/code>, or a regular account with working <code>sudo<\/code> privileges.<\/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 workstation. A domain is not required because this guide keeps Portainer on the VPS loopback address.<\/li>\n\n\n<li>A <a href=\"https:\/\/vpslake.com\/buy-vps\">VPSLake Linux VPS<\/a> if you need a root-access CentOS Stream server.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The commands use <code>sudo<\/code> for a regular SSH user. If you are logged in as <code>root<\/code>, remove <code>sudo<\/code> from each command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Check the release and update CentOS Stream<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Confirming the release and architecture prevents you from adding a repository for the wrong Enterprise Linux version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -E '^(PRETTY_NAME|VERSION_ID|PLATFORM_ID)=' \/etc\/os-release\nuname -m\nsudo dnf -y upgrade<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see CentOS Stream 9 and normally <code>x86_64<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PRETTY_NAME=\"CentOS Stream 9\"\nVERSION_ID=\"9\"\nPLATFORM_ID=\"platform:el9\"\nx86_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">CentOS\u2019s <code>centos-extras<\/code> repository is normally enabled by default and is required by Docker\u2019s supported installation path. If a minimal image has disabled it, you will re-enable the <code>extras-common<\/code> repository after installing DNF\u2019s repository helper in Step 3. Resolve any DNS, mirror, or GPG signature error before installing Docker.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Remove conflicting Docker packages<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The distribution may contain older Docker package names that conflict with Docker\u2019s maintained packages, so remove only those old Docker packages before adding the official repository.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf remove -y docker \\\n  docker-client \\\n  docker-client-latest \\\n  docker-common \\\n  docker-latest \\\n  docker-latest-logrotate \\\n  docker-logrotate \\\n  docker-engine<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">DNF may report that some packages were not installed; that is normal on a fresh VPS. This removal does not erase images, containers, volumes, or networks stored under <code>\/var\/lib\/docker\/<\/code>. Do not remove packages from an existing production host until you know what its current container workloads use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Add Docker\u2019s official CentOS repository<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using Docker\u2019s repository keeps the Engine, containerd, Buildx, and Compose plugin available as a compatible package set. Docker documents this method in its <a href=\"https:\/\/docs.docker.com\/engine\/install\/centos\/\" target=\"_blank\" rel=\"noopener\">CentOS installation guide<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install the DNF repository helper and register the CentOS Stream repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf -y install dnf-plugins-core ca-certificates\nsudo dnf config-manager --set-enabled extras-common\nsudo dnf config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo\nsudo dnf makecache<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that DNF can see the stable Docker packages before installing them:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf list docker-ce --showduplicates | tail -n 5<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output should contain <code>docker-ce<\/code> entries from <code>docker-ce-stable<\/code>. Package versions change over time; do not copy a version from the example output into your command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Install, start, and test Docker Engine<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Installing the Compose plugin now gives Portainer a complete Docker host and leaves the standard <code>docker compose<\/code> command available for later application stacks.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf -y install 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 will show an active, enabled service and version values that vary with current releases:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>active\nenabled\nClient x.y.z \/ Server x.y.z\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 daemon access, registry connectivity, and the 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: Keep the Portainer service off the public interface<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">CentOS Stream 9 uses firewalld and SELinux in a typical VPS image. Portainer will bind only to <code>127.0.0.1<\/code>, so you do not need to add a public rule for 9443 or the optional Edge Agent port 8000.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the current security state without disabling either service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>getenforce\nsudo systemctl is-active firewalld\nsudo firewall-cmd --state 2&gt;\/dev\/null || true<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Typical output is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enforcing\nactive\nrunning<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Keep your existing SSH firewall rule. The tunnel in the next step uses that rule; this guide does not open a new inbound port. If firewalld is active, do not add 9443 because Docker\u2019s loopback binding already prevents direct internet access.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Deploy Portainer CE with persistent data<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The named volume stores Portainer\u2019s users, settings, and environment records outside the container, so replacing the image does not reset the dashboard. Portainer\u2019s <a href=\"https:\/\/docs.portainer.io\/start\/install-ce\/server\/docker\/linux\" target=\"_blank\" rel=\"noopener\">official Docker installation guide<\/a> documents the socket mount, HTTPS port, and SELinux requirement used here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the volume and launch the LTS image. The <code>--privileged<\/code> flag is needed for Portainer\u2019s Docker-socket integration when SELinux is enabled; it does not disable SELinux on the host.<\/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  --privileged \\\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 long container ID. Confirm that the container is running and that the host-side port is private:<\/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 creates a self-signed certificate for its first HTTPS connection. A browser warning is expected through the private tunnel; do not reuse that certificate for a public deployment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 7: Open the dashboard through SSH<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An SSH local forward carries browser traffic from your workstation to the VPS-only listener, avoiding a public Portainer firewall exception.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run this command on your local computer, not in the VPS shell. Replace the uppercase placeholders 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\">Open <code>https:\/\/127.0.0.1:9443<\/code> in your browser. If Portainer asks for a setup token, retrieve it on the VPS with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker logs portainer 2&gt;&amp;1 | grep -m1 'setup_token='<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the token into the setup page, create a unique administrator password of at least 12 characters, and choose the automatically detected local Docker environment. The first Portainer account is an administrator, so use a password that is not reused anywhere else.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If port 9443 is already occupied on your workstation, change only the local port:<\/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 browse to <code>https:\/\/127.0.0.1:19443<\/code>. The VPS-side listener remains private on 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\">These checks prove that Docker starts at boot, the Portainer restart policy is set, the listener is bound to loopback, and the HTTPS endpoint 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 ':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 browser through the SSH tunnel. You should see Portainer\u2019s setup page or dashboard, and the local Docker environment should be available after setup.<\/p>\n\n\n\n<aside class=\"vl-element vl-cta-banner\" aria-label=\"Run Docker and Portainer\">\n\t<div class=\"vl-cta-banner__content\">\n\t\t<p class=\"vl-cta-banner__eyebrow\">CentOS Stream VPS<\/p>\n\t\t<h3 class=\"vl-cta-banner__title\">Run Docker and Portainer<\/h3>\n\t\t<p class=\"vl-cta-banner__text\">Get a root-access CentOS Stream VPS for a private Docker management dashboard.<\/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>No match for argument: docker-ce<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">DNF cannot see Docker\u2019s repository, or its metadata is stale. Inspect the repository list and rebuild the cache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf repolist --enabled | grep -i docker\nsudo dnf makecache\ndnf list docker-ce --showduplicates<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see <code>docker-ce-stable<\/code>. If it is missing, repeat the <code>dnf config-manager --add-repo<\/code> command from Step 3 and confirm that the VPS can resolve <code>download.docker.com<\/code> over HTTPS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>package docker-ce conflicts with ...<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An older distribution Docker package is still installed, or DNF has selected a conflicting runtime. Review the installed Docker packages, then rerun the removal command from Step 2 before trying the install again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -qa | grep -E '^(docker|containerd)' | sort<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do not remove Podman or <code>runc<\/code> merely because they exist. On an established server, identify which service owns the running containers before changing its runtime.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Portainer restarts or logs an SELinux denial<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Portainer needs to reach the Docker socket, and SELinux can block that access unless the container is privileged. Inspect the host mode, recent logs, and the container setting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>getenforce\nsudo docker logs --tail 100 portainer\nsudo docker inspect --format '{{.HostConfig.Privileged}}' portainer<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The last command should print <code>true<\/code>. If it prints <code>false<\/code>, recreate only the Portainer container with the <code>--privileged<\/code> option, loopback publish, socket mount, and <code>portainer_data<\/code> volume from Step 6. Do not disable SELinux; the named volume preserves the dashboard data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>bind: address already in use<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Another process already owns port 9443 on the VPS. Find it before changing the container mapping:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ss -lntp | grep ':9443'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you need another port, publish <code>127.0.0.1:19443:9443<\/code>, forward <code>19443:127.0.0.1:19443<\/code> in the SSH command, and browse to <code>https:\/\/127.0.0.1:19443<\/code>. Keep the host-side address on loopback.<\/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 Portainer on loopback. If several administrators need access, use a reverse proxy with a trusted certificate, strong authentication, and a firewalld rule limited to the required HTTPS sources.<\/li>\n\n\n<li>Treat the Docker socket and Portainer administrator account as root-equivalent access. Limit both to trusted operators and avoid publishing Docker\u2019s unauthenticated TCP API on port 2375.<\/li>\n\n\n<li>Back up the <code>portainer_data<\/code> volume before changing the image tag, and monitor free disk space under Docker\u2019s data directory.<\/li>\n\n\n<li>Review your SSH exposure with VPSLake\u2019s <a href=\"https:\/\/vpslake.com\/sshd-hardening-generator\">SSH hardening generator<\/a> 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\">Does CentOS Stream 9 use <code>dnf<\/code> or <code>yum<\/code> for Docker?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>dnf<\/code>. CentOS Stream 9 is an Enterprise Linux 9 release, and Docker\u2019s current CentOS instructions use DNF\u2019s repository plugin and the CentOS RPM repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need to open 9443 in firewalld?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. The Docker publish option binds 9443 to <code>127.0.0.1<\/code>, not the VPS\u2019s public address. The SSH tunnel reaches that private listener, so no new inbound Portainer rule is required.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why is port 8000 missing from the Docker command?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Port 8000 is Portainer\u2019s optional tunnel service for Edge Agent features. A Portainer Server managing the Docker Engine on the same VPS through <code>\/var\/run\/docker.sock<\/code> does not need it, so leaving it unpublished reduces exposure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I update Portainer without losing settings?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Keep the <code>portainer_data<\/code> volume, back it up, and replace only the container with the intended LTS image. The volume contains the Portainer database and environment configuration; deleting it would remove those settings.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Does CentOS Stream 9 use `dnf` or `yum` for Docker?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Use `dnf`. CentOS Stream 9 is an Enterprise Linux 9 release, and Docker\u2019s current CentOS instructions use DNF\u2019s repository plugin and the CentOS RPM repository.\"}}, {\"@type\": \"Question\", \"name\": \"Do I need to open 9443 in firewalld?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. The Docker publish option binds 9443 to `127.0.0.1`, not the VPS\u2019s public address. The SSH tunnel reaches that private listener, so no new inbound Portainer rule is required.\"}}, {\"@type\": \"Question\", \"name\": \"Why is port 8000 missing from the Docker command?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Port 8000 is Portainer\u2019s optional tunnel service for Edge Agent features. A Portainer Server managing the Docker Engine on the same VPS through `\/var\/run\/docker.sock` does not need it, so leaving it unpublished reduces exposure.\"}}, {\"@type\": \"Question\", \"name\": \"Can I update Portainer without losing settings?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. Keep the `portainer_data` volume, back it up, and replace only the container with the intended LTS image. The volume contains the Portainer database and environment configuration; deleting it would remove those settings.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Install docker portainer on centos stream 9 with Docker Engine, persistent data, SELinux-safe settings, private HTTPS access, and verification.","protected":false},"author":1,"featured_media":1088,"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":[111,119,118,137],"class_list":["post-1087","post","type-post","status-publish","format-standard","has-post-thumbnail","category-guides","category-vps-hosting","tag-centos-stream-9","tag-containers","tag-docker","tag-portainer","cs-entry"],"_links":{"self":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1087","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=1087"}],"version-history":[{"count":1,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1087\/revisions"}],"predecessor-version":[{"id":4041,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1087\/revisions\/4041"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media\/1088"}],"wp:attachment":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media?parent=1087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/categories?post=1087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/tags?post=1087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}