DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober 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 PC×
Skip to content
VGSources
Blog

How to Install and Use Docker on a Debian VPS

A practical Debian VPS guide to Docker Engine: repository setup, package installation, non-root access, startup after reboot, Compose, port publishing, firewall caveats, and troubleshooting.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Docker Engine from Docker’s official APT repository, verify it with a test container, then decide whether to use the root-owned socket or configure non-root access. This procedure applies to Debian 13 (Trixie), Debian 12 (Bookworm), and the listed amd64, armhf, arm64, and ppc64le architectures. On a public VPS, treat published container ports as internet-facing unless you explicitly bind or filter them.

What you need before installing Docker

Docker runs as a daemon on the VPS. You control it over SSH with the Docker CLI, and containers share the host’s kernel while remaining isolated from the host’s normal processes and filesystem paths. Installation changes system packages, adds a privileged service, and may create firewall rules, so use an account with sudo access and keep a second SSH session available while you work.

As an Amazon Associate I earn from qualifying purchases.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Supported Debian releases and CPU architectures

Debian release Status in Docker’s Debian instructions Architectures listed
Debian 13 (Trixie) Stable x86_64 (amd64), armhf (arm/v7), arm64, ppc64le
Debian 12 (Bookworm) Oldstable

Check the VPS before changing anything:

cat /etc/os-release
dp​kg --print-architecture
uname -m

The first command identifies the Debian release and codename; the second reports the architecture used by APT. If you are running a Debian derivative, Docker’s guidance is to follow the Debian procedure while substituting that distribution’s release version. Confirm that the derivative supplies a compatible codename and systemd environment before adding a Debian repository.

Confirm administrative access and systemd

sudo -v
systemctl is-system-running || true
df -h /
free -h
  • Administrative access: every installation command that changes packages or services requires sudo unless you are logged in as root.
  • Systemd: Debian VPS images normally use it to start Docker and containerd.
  • Storage and memory: Docker images, writable container layers, build caches, and logs consume VPS disk and RAM. Check capacity before pulling large images.
  • Network policy: know which ports the VPS provider and host firewall allow. Docker-published ports can be reachable even when a normal UFW or firewalld rule appears to deny them.

Remove packages that can conflict with Docker Engine

Distribution-supplied or unofficial Docker packages can conflict with the packages in Docker’s repository. Remove them before adding the official source. Removing a package does not automatically delete your application data, but stop any workloads that depend on the old daemon first and review the proposed APT changes.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
sudo apt update
sudo apt remove docker.io docker-compose docker-compose-v2 podman-docker containerd runc

APT may report that one or more names are not installed; that is harmless. If it proposes removing software you still need, answer n, inspect the dependency list, and remove only the conflicting Docker or container-runtime package. Do not delete /var/lib/docker merely to resolve a package conflict: that directory can contain images, volumes, and container data from an earlier installation.

Add Docker’s official APT repository

Using Docker’s repository gives you Docker Engine, the Docker CLI, containerd, Buildx, and the Compose plugin as coordinated packages. The key and repository must be installed before the Engine packages can be found.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Install the tools used to fetch and verify the repository metadata.
    sudo apt update
    sudo apt install ca-certificates curl
    
  2. Create the keyring directory with root ownership.
    sudo install -m 0755 -d /etc/apt/keyrings
    
  3. Download Docker’s signing key and make it readable by APT.
    sudo curl -fsSL https://download.docker.com/linux/debian/gpg 
      -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
  4. Add a repository entry that follows the VPS architecture and Debian codename.
    echo "Types: deb
    URIs: https://download.docker.com/linux/debian
    Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
    Components: stable
    Architectures: $(dpkg --print-architecture)
    Signed-By: /etc/apt/keyrings/docker.asc" | sudo tee /etc/apt/sources.list.d/docker.sources > /dev/null
    

    The codename must match the release shown by /etc/os-release. Do not substitute a different Debian release simply because it is newer; a mismatched suite can produce dependency errors or install incompatible packages.

  5. Refresh package metadata and confirm that the repository is visible.
    sudo apt update
    apt-cache policy docker-ce
    

    apt-cache policy should show a candidate version from Docker’s repository. If it shows no candidate, check the codename, architecture, key-file permissions, and the output from sudo apt update before continuing.

Install Docker Engine and its companion packages

Install the Engine, command-line client, containerd runtime, Buildx build driver, and Compose plugin together:

sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

These are the package names used in the current Docker Debian repository flow. Package availability can change when a Debian release moves between stable and oldstable, so treat an “unable to locate package” error as a repository or release issue to diagnose rather than as a reason to download random packages from a third-party source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Check that the daemon is running and that the client can reach it:

sudo systemctl status docker --no-pager
sudo docker version
sudo docker info

docker version displays client and server sections when the daemon is reachable. docker info reports the storage driver, container count, runtime, and other host details. If the status is failed, inspect the journal before retrying:

sudo journalctl -u docker.service -n 100 --no-pager
sudo journalctl -u containerd.service -n 100 --no-pager

Make Docker start after a reboot

On Debian and Ubuntu, Docker normally starts on boot after installation. Verify the behavior rather than assuming it, especially on a provider image with customized systemd units:

sudo systemctl is-enabled docker.service
sudo systemctl is-enabled containerd.service
sudo systemctl enable --now docker.service containerd.service

enable --now both enables the units for future boots and starts them immediately. On some systemd distributions Docker can be socket-activated, and package behavior differs, so check the service after a reboot:

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

Reconnect over SSH and run:

systemctl status docker --no-pager
docker info

If Docker is active but containers are not restarting, container restart policy is a separate setting; enabling the service does not automatically restart every container. Later, use a policy such as --restart unless-stopped when you create a long-running container, or define the equivalent in a Compose file.

Use Docker without typing sudo

The daemon listens on a Unix socket owned by the docker group. Some distributions create that group during installation; check and create it only if necessary:

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
getent group docker || sudo groupadd docker
sudo usermod -aG docker "$USER"

Log out of every SSH session for that user and log back in. Opening another terminal from the same login is not sufficient because existing processes retain their old group credentials. For immediate access in the current shell, use:

newgrp docker

Then verify the non-root path:

docker run --rm hello-world

Membership in the docker group grants root-level control of the host: a user who can start a container with the host filesystem or device access can usually obtain equivalent privileges. Give this access only to administrators you trust. If that privilege boundary is unacceptable, investigate Docker’s rootless mode instead of adding users to the group. Rootless mode has different prerequisites and operational limits, so do not mix its instructions with the system-wide daemon procedure above.

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

Run your first containers

Verify the installation with Hello World

The test image downloads from a registry, starts a short-lived container, prints a confirmation message, and exits. The --rm flag removes the stopped container automatically:

docker run --rm hello-world

If this succeeds without sudo, the CLI, daemon, image pull, and non-root socket permissions are working together.

Run a web server and publish a port

This example starts an NGINX container in the background, maps host port 8080 to container port 80, and gives it a readable name:

docker run -d --name web-demo -p 8080:80 nginx

Check its state and the port mapping:

docker ps
docker port web-demo
curl http://127.0.0.1:8080

Stop and remove it when finished:

docker stop web-demo
docker rm web-demo

In -p 8080:80, the first number is the VPS host port and the second is the port inside the container. Because no host address is specified, Docker normally listens on all host interfaces. That is an exposure decision, not merely a connectivity setting.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Understand Docker ports and the VPS firewall caveat

Docker’s Debian documentation warns that published ports can bypass UFW or firewalld rules. A rule that denies port 8080 in the firewall’s ordinary input chain may not prevent traffic from reaching a container after Docker has installed its forwarding rules. On a public VPS, choose one of these patterns deliberately.

Keep the service private to the VPS

Bind the host side to loopback so only processes on the VPS can reach it:

docker run -d --name web-private -p 127.0.0.1:8080:80 nginx

This is appropriate when a reverse proxy on the same machine will be the public entry point, or when you access the service through an SSH tunnel. It prevents direct connections to port 8080 from the internet.

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

Publish publicly only when the application requires it

Use an explicit host port, document why it is public, and restrict access with the VPS provider’s network controls and Docker-aware filtering. For services that must be filtered before containers receive traffic, put rules in the DOCKER-USER chain rather than relying solely on the normal UFW or firewalld input rules. Test from an external network after applying the rule; a local curl proves only local reachability.

Do not confuse EXPOSE with publication

An image’s EXPOSE metadata documents an intended container port. It does not make that port reachable from the VPS network. The -p option (or a Compose ports entry) creates the host mapping that can expose the service.

Use Docker Compose for multi-container applications

The Compose plugin is installed as docker-compose-plugin and is invoked as docker compose with a space, not the older standalone docker-compose command. Create a project directory and a file named compose.yaml:

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
mkdir -p ~/web-stack
cd ~/web-stack
nano compose.yaml

A minimal example with a private application port is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
services:
  web:
    image: nginx:latest
    restart: unless-stopped
    ports:
      - "127.0.0.1:8080:80"

Start it in the background and inspect the resulting service:

docker compose up -d
docker compose ps
docker compose logs --follow web

Use Ctrl+C to leave the log view without stopping the service. Apply a changed file with docker compose up -d again, stop the project with docker compose down, and remove its containers and network while leaving named volumes intact unless you add --volumes. Keep credentials out of a file that is readable by every VPS user, and pin image tags deliberately for production rather than relying on a moving latest tag.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Essential Docker commands on a Debian VPS

Task Command What to check
List running containers docker ps Name, status, and published ports
List all containers docker ps -a Exited containers and their exit status
View logs docker logs --follow CONTAINER Startup errors and application output
Open a shell docker exec -it CONTAINER sh Use bash only when the image includes it
Stop a container docker stop CONTAINER Graceful shutdown before removal
Remove a stopped container docker rm CONTAINER Container metadata is deleted; volumes may remain
List local images docker image ls Tags, image IDs, and disk usage
Remove an unused image docker image rm IMAGE No container should still depend on that image
Check disk consumption docker system df Images, containers, local volumes, and build cache

Never treat docker system prune as a harmless cleanup shortcut on a production VPS. It can remove stopped containers, unused networks, dangling images, and build cache; adding volume cleanup can delete persistent data. Identify each object first and back up important volumes outside the VPS.

Troubleshoot the failures you are most likely to see

“Cannot connect to the Docker daemon”

  • Check sudo systemctl status docker.
  • If it is stopped, run sudo systemctl start docker and inspect sudo journalctl -u docker.service -n 100 --no-pager if it fails.
  • Confirm that containerd is available with sudo systemctl status containerd.
  • Check that the client is using the expected local socket and that no stale DOCKER_HOST environment variable points elsewhere: env | grep DOCKER_HOST.

“Permission denied” on the Docker socket

Run id and confirm that docker appears in the groups list. If you just used usermod, log out and back in or run newgrp docker. Do not repeatedly solve this with sudo if you intend to use the non-root workflow; fix the session’s group membership instead.

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

APT cannot find a Docker package

  • Run cat /etc/os-release and verify that the repository suite matches the Debian codename.
  • Run dpkg --print-architecture and confirm that it is one of Docker’s listed architectures.
  • Review the complete output of sudo apt update for a bad signature, unreachable repository, or malformed source file.
  • Use apt-cache policy docker-ce to see whether APT has a candidate from Docker’s repository.

The container is running but the website is unreachable

  1. Run docker ps and confirm that the container is still running.
  2. Run docker port CONTAINER and verify the host-to-container mapping.
  3. Test locally with curl http://127.0.0.1:HOST_PORT.
  4. Check whether you intentionally bound the service to 127.0.0.1; that prevents remote clients from connecting directly.
  5. If the service is intentionally public, check provider-level security rules and Docker-aware filtering, including the DOCKER-USER chain.
  6. Read application output with docker logs CONTAINER; a process that listens only on a different container interface or port will not respond to the mapping you chose.

The service disappears after a reboot

Check both layers: systemctl status docker confirms the daemon, while docker ps -a shows whether the container exists. A container that exists but does not restart needs an explicit restart policy such as --restart unless-stopped or restart: unless-stopped in Compose.

Operate Docker safely on a VPS

  • Limit membership: the docker group is equivalent to root-level control; grant it only to trusted administrators.
  • Expose the minimum: prefer loopback bindings behind a reverse proxy, and publish only ports that remote clients genuinely need.
  • Protect persistent data: use named volumes or deliberate bind mounts, document their host paths, and back them up independently of container recreation.
  • Manage logs and disk: monitor docker system df, container logs, and VPS filesystem usage so a full disk does not take down unrelated services.
  • Update deliberately: review image changes, recreate containers through Compose where possible, and keep the Docker packages maintained through APT.
  • Keep SSH recovery available: test firewall changes from a second session so a mistaken rule does not lock you out.

Installation checklist

  1. Confirm Debian 13 Trixie or Debian 12 Bookworm, a supported architecture, sudo access, systemd, and adequate disk space.
  2. Remove conflicting distribution packages without deleting /var/lib/docker blindly.
  3. Add Docker’s signing key and official APT repository using the VPS’s actual codename and architecture.
  4. Install docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, and docker-compose-plugin.
  5. Verify the daemon with docker version, docker info, and docker run --rm hello-world.
  6. Enable and test the services across a reboot.
  7. Choose deliberately between root-owned CLI access, the privileged docker group, and rootless mode.
  8. Publish ports only after deciding whether each service is private or public, because Docker-published ports can bypass ordinary UFW or firewalld expectations.

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.

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 quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.