Installing Docker via the command line on a Scout server
This guide covers installing Docker Community Edition (Docker CE) on a CentOS or RHEL 8 based Scout Control Panel server, enabling the service, and configuring a Scout site to proxy to a Docker container. It also covers granting a site user the ability to manage Docker with sudo.
You will need root (or sudo) access to the server to install packages. The commands below assume a CentOS 8 / RHEL 8 system using dnf. Adjust accordingly for other distributions.
Step 1: Install the prerequisites
Make sure yum-utils is installed. It provides dnf config-manager, which we use to add the Docker repository.
dnf install -y yum-utils
Step 2: Add the official Docker CE repository
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Step 3: Install Docker CE and the Compose plugin
Install the Docker engine, CLI, containerd runtime and the Compose v2 plugin in one go:
dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Accept the prompts to install the packages and to import the Docker GPG key when asked.
Step 4: Enable and start the Docker service
Enable Docker so it starts automatically on boot, and start it immediately:
systemctl enable --now docker
You can confirm the service is running with systemctl status docker and that the CLI works with docker ps.
Step 5: Allow a site user to manage Docker via sudo
Scout site users do not have root, but you can grant a specific user the ability to run docker commands via sudo without a password. Edit the sudoers file safely with visudo:
visudo
Add a line in the form below, replacing siteuser with the actual Scout site username:
siteuser ALL=(ALL) NOPASSWD: /usr/bin/docker
The site user can now run Docker commands using sudo, for example:
sudo docker ps
sudo docker ps -a --format "table {{.Names}}\t{{.Status}}\t{{.RunningFor}}"
Step 6: Build and run a container
From the directory containing your application’s Dockerfile, build an image with a meaningful tag:
docker build -t myapp:production .
Then run the container, mapping a host port to the container’s listening port. The example below maps host port 8080 to container port 9001, mounts two directories for persistent data, sets NODE_ENV=production, and uses a restart policy of unless-stopped so the container is brought back up automatically after a server reboot:
docker run -dp 8080:9001 \
-v /home/siteuser/site/public_html/client/reports:/app/client/reports \
-v /home/siteuser/site/public_html/server/data:/app/server/data \
-e NODE_ENV=production \
--restart unless-stopped \
--name myapp-production \
myapp:production
The --restart unless-stopped policy ensures the container restarts automatically when the Docker service or the server itself is restarted, unless you explicitly stop it.
You can confirm the policy on a running container with:
docker inspect myapp-production --format '{{.HostConfig.RestartPolicy.Name}}'
Step 7: Configure the Scout site to proxy to the container
Once your container is running and listening on a host port (8080 in the example above), point the Scout Control Panel site at it. In the Scout control panel, open the site’s Application settings and:
- Set Application to Proxy.
- In Proxy address, enter the full URL including protocol and port, for example
http://127.0.0.1:8080. - Click Update to save.

Scout will then forward all requests for the site through to the container. Test the site to confirm everything is working as expected; you can use a local hosts file entry to verify the response before changing public DNS.
Useful day-to-day Docker commands
# List running containers
docker ps
# List all containers (including stopped)
docker ps -a
# View logs for a container
docker logs --tail 200 -f myapp-production
# Restart, stop, start a container
docker restart myapp-production
docker stop myapp-production
docker start myapp-production
# Remove a stopped container
docker rm myapp-production
# Remove an image
docker rmi myapp:production
Related guide
If your application is a plain Node.js app rather than a Dockerised one, you may not need Docker at all. See our companion guide on installing Node.js on a Scout Control Panel server.