Docker in ISPmanager on a VPS

Docker runs services in isolated containers: Redis or Memcached for caching, Elasticsearch for search, another MySQL version or your own app. They do not interfere with system packages and are easy to remove. The "Docker" section appears after Docker is installed in "Software configuration": Software configuration. It has containers, images and the configuration file.

Docker containers
Docker containers

Create a container

  1. "Docker" → "Create a container".
  2. Find the image in the Docker Hub catalog with the search, for example redis, and click "Select" on its card.
  3. Set the container name and version (tag). Prefer a specific one, for example 7, rather than latest: the container will not update unexpectedly.
  4. Enable autostart so that the container comes up after a VPS reboot.
  5. Set ports: server port → container port. If needed, limit memory, add environment variables and a folder or volume for data.
  6. Click "Create". The container installs in the background and appears in the list.

Publish a service needed only by the sites on this VPS on 127.0.0.1. The same for Redis with a password from the console:

docker run -d --name redis --restart unless-stopped \
  -p 127.0.0.1:6379:6379 redis:7 redis-server --requirepass 'PASSWORD'

Management

Tick a container: start, stop, delete, settings (autostart, memory and CPU limits), the container log and creating an image from it are available. "Configuration file" holds the settings of Docker itself.

docker ps                 # running containers
docker logs -f redis      # log
docker exec -it redis sh  # shell inside
docker stats              # memory and CPU

A port published by Docker on all addresses is reachable from the internet even with the firewall closed: Docker adds its own iptables rules that bypass it. Do not publish Redis and database ports to the outside without a password.

Data and backups

  • Docker is not included in panel backups. Keep data in a mounted server folder or a volume and copy it separately; dump databases inside containers.
  • Without a folder or volume, container data is lost when the container is recreated.
  • Images and stopped containers take disk space: docker system prune — disk space.

Alternative MySQL versions also run in Docker, but are created in "Database servers": Database servers.

Questions and answers
Publish the port on 127.0.0.1, not on all addresses, and do not open it in the firewall.
Autostart is off. Turn it on in the container settings or run the container with --restart unless-stopped.
Keep data in a volume or a mounted server folder. Docker is not included in panel backups, so copy this data separately.