{"id":1095,"date":"2026-11-16T03:00:00","date_gmt":"2026-11-16T03:00:00","guid":{"rendered":"https:\/\/vpslake.com\/blog\/?p=1095"},"modified":"2026-11-16T03:00:00","modified_gmt":"2026-11-16T03:00:00","slug":"install-docker-portainer-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/vpslake.com\/blog\/2026\/11\/16\/install-docker-portainer-rocky-linux-8\/","title":{"rendered":"How to Install Docker Portainer on Rocky Linux 8"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Install docker portainer on Rocky Linux 8 and finish with a working Docker Engine plus a persistent Portainer CE dashboard in about ten minutes. The setup keeps Portainer\u2019s HTTPS listener private and lets you open it from your computer through SSH.<\/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 Rocky Linux 8 VPS with at least 2 GB of RAM and 10 GB of free disk space for Docker 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 RPM repository and Docker Hub.<\/li>\n\n\n<li>An SSH client on your local computer. You do not need a domain for the loopback-only dashboard in this guide.<\/li>\n\n\n<li>A <a href=\"https:\/\/vpslake.com\/buy-vps\">VPSLake Linux VPS<\/a> if you need a root-access server for this Docker deployment.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The commands use <code>sudo<\/code> for a non-root account. If you are logged in as <code>root<\/code>, remove <code>sudo<\/code> from each command. Rocky Linux 8 uses DNF, firewalld, and usually enforcing SELinux; this guide keeps those defaults in place.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Confirm Rocky Linux 8 and update the VPS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Checking the release and architecture first prevents you from adding an Enterprise Linux repository for the wrong system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -E '^(PRETTY_NAME|VERSION_ID|PLATFORM_ID|ID_LIKE)=' \/etc\/os-release\nuname -m\nsudo dnf -y upgrade<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The version should identify Rocky Linux 8 and the architecture should normally be <code>x86_64<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PRETTY_NAME=\"Rocky Linux 8.x (Green Obsidian)\"\nVERSION_ID=\"8.x\"\nPLATFORM_ID=\"platform:el8\"\nID_LIKE=\"rhel centos fedora\"\nx86_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The minor release and kernel version will vary. Resolve any repository, DNS, or GPG-signature error before continuing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Remove conflicting packages and add Docker\u2019s repository<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Docker\u2019s Engine packages include the runtime components they expect, so an older distribution Docker stack can prevent DNF from resolving dependencies.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On a new VPS, remove only the common conflicting package names:<\/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 \\\n  podman \\\n  runc<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">DNF may report that some packages are not installed. It does not erase images, containers, or volumes under <code>\/var\/lib\/docker\/<\/code>, but do not remove an active runtime from a production host until you have checked its workloads.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Docker\u2019s <a href=\"https:\/\/docs.docker.com\/engine\/install\/rhel\/\" target=\"_blank\" rel=\"noopener\">official RHEL installation guide<\/a> uses the matching repository for the RHEL-compatible EL8 layout used by Rocky Linux. Install the repository helper, register it, and refresh metadata:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y dnf-plugins-core ca-certificates\nsudo dnf config-manager --add-repo https:\/\/download.docker.com\/linux\/rhel\/docker-ce.repo\nsudo dnf makecache<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that the repository offers an EL8 Docker package before installing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf list --showduplicates docker-ce | tail -n 5<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see <code>docker-ce<\/code> entries from Docker\u2019s stable repository. The exact version changes as new releases arrive.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Install and test Docker Engine<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Installing the Compose plugin with Docker gives Portainer a complete Engine host and leaves <code>docker compose<\/code> available for later application stacks.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf 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 daemon and version values that vary by release:<\/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 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 output 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 4: Check firewalld and SELinux<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Portainer will be published only on <code>127.0.0.1<\/code>, so you do not need to open a public rule for its HTTPS port or its optional Edge Agent port.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inspect the host security services without changing them:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>getenforce\nsudo systemctl is-active firewalld\nsudo firewall-cmd --get-active-zones<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Typical output looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enforcing\nactive\npublic\n  interfaces: eth0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Keep the existing SSH firewall rule because the next step uses SSH. Do not add port 9443 to a public firewalld zone: a loopback binding prevents outside connections even when Docker manages its own forwarding rules.<\/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 separate from the container, so recreating the container 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> uses the same Docker socket and data-volume arrangement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because Rocky Linux commonly runs SELinux in enforcing mode, <code>--privileged<\/code> is required for Portainer\u2019s local Docker-socket integration. This does not disable SELinux; the host policy remains enabled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the volume and start the current long-term-support image. Port 8000 is omitted because it is only needed for Edge Agent tunnel features, not for a Portainer Server managing Docker on this VPS:<\/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 listener 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 generates a self-signed certificate for its first HTTPS connection. A browser warning is expected when you access it through the private tunnel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Open Portainer through an SSH tunnel<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The SSH local forward carries browser traffic to the VPS listener without exposing Portainer on the public address or adding a firewalld 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. Continue past the self-signed certificate warning only when the address is exactly <code>127.0.0.1<\/code>, create a unique administrator password of at least 12 characters, and choose the automatically detected local Docker environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If port 9443 is already in use on your computer, change only the local 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 browse to <code>https:\/\/127.0.0.1:19443<\/code>. The VPS-side listener remains on private port 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 restarts automatically, and its HTTPS service is reachable only from the host:<\/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 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\">Rocky Linux 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 Rocky Linux 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. Confirm that the RHEL repository file is enabled and refresh 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 --showduplicates docker-ce<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output should contain Docker\u2019s stable repository and an EL8 package. If it does not, repeat the <code>dnf config-manager --add-repo<\/code> command from Step 2 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 Docker package, Podman runtime, or standalone <code>runc<\/code> installation is still present. On a fresh VPS, rerun the removal command from Step 2 and retry the install; on an established host, identify which service owns the containers before changing its runtime.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -qa | grep -E '^(docker|containerd|podman|runc)' | sort<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do not remove packages blindly from a host that already runs important workloads.<\/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 access to 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 80 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 <code>--privileged<\/code>, the loopback publish option, the socket mount, and the existing <code>portainer_data<\/code> volume. Do not disable SELinux.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The browser cannot connect to <code>127.0.0.1:9443<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The tunnel must run on your workstation and remain open. Start it again, then check the container and listener on the VPS:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker ps --filter name=portainer\nsudo ss -lntp | grep ':9443'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The container\u2019s port column should show <code>127.0.0.1:9443-&gt;9443\/tcp<\/code>. If the container is stopped, inspect <code>sudo docker logs portainer<\/code>; do not browse to <code>https:\/\/SERVER_IP:9443<\/code> because this setup intentionally keeps that address private.<\/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 you later need shared access, place it behind a reverse proxy with a trusted certificate, authentication, and a narrowly scoped firewalld rule.<\/li>\n\n\n<li>Treat the Docker socket and Portainer administrator account as root-equivalent access. Do not expose Docker\u2019s unauthenticated TCP API on port 2375.<\/li>\n\n\n<li>Back up the <code>portainer_data<\/code> volume before replacing the image, and monitor free space under Docker\u2019s data directory.<\/li>\n\n\n<li>Review 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\">Why does Rocky Linux 8 use Docker\u2019s RHEL repository?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Rocky Linux follows the RHEL-compatible Enterprise Linux package layout. Docker publishes a RHEL 8 repository path, so the RHEL repo file is the appropriate current source for Docker packages on Rocky 8; do not mix it with Ubuntu APT instructions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need to open port 9443 in firewalld?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Docker binds the host side to <code>127.0.0.1<\/code>, which is not the VPS\u2019s public interface. The SSH tunnel reaches that local listener, so no new inbound Portainer rule is needed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is Portainer port 8000 for?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Port 8000 is an optional tunnel used by Portainer Edge Agent features. A local Portainer Server using <code>\/var\/run\/docker.sock<\/code> to manage Docker on the same VPS can leave that port unpublished.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I update Portainer without losing its 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 Portainer container during a planned upgrade. The volume contains the Portainer database and configuration, while Docker application containers remain separate.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Why does Rocky Linux 8 use Docker\u2019s RHEL repository?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Rocky Linux follows the RHEL-compatible Enterprise Linux package layout. Docker publishes a RHEL 8 repository path, so the RHEL repo file is the appropriate current source for Docker packages on Rocky 8; do not mix it with Ubuntu APT instructions.\"}}, {\"@type\": \"Question\", \"name\": \"Do I need to open port 9443 in firewalld?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. Docker binds the host side to `127.0.0.1`, which is not the VPS\u2019s public interface. The SSH tunnel reaches that local listener, so no new inbound Portainer rule is needed.\"}}, {\"@type\": \"Question\", \"name\": \"What is Portainer port 8000 for?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Port 8000 is an optional tunnel used by Portainer Edge Agent features. A local Portainer Server using `\/var\/run\/docker.sock` to manage Docker on the same VPS can leave that port unpublished.\"}}, {\"@type\": \"Question\", \"name\": \"Can I update Portainer without losing its settings?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. Keep the `portainer_data` volume, back it up, and replace only the Portainer container during a planned upgrade. The volume contains the Portainer database and configuration, while Docker application containers remain separate.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Install docker portainer on Rocky Linux 8 with Docker Engine, SELinux-safe settings, private HTTPS access, persistent storage, and fixes for fresh VPS setups.","protected":false},"author":1,"featured_media":1096,"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,118,137,105],"class_list":["post-1095","post","type-post","status-publish","format-standard","has-post-thumbnail","category-guides","category-vps-hosting","tag-containers","tag-docker","tag-portainer","tag-rocky-linux-8","cs-entry"],"_links":{"self":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1095","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=1095"}],"version-history":[{"count":1,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1095\/revisions"}],"predecessor-version":[{"id":4057,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/1095\/revisions\/4057"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media\/1096"}],"wp:attachment":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media?parent=1095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/categories?post=1095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/tags?post=1095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}