Skip to content
English
  • There are no suggestions because the search field is empty.

Setup Guide Docker (Linux)

This is a comprehensive guide to prepare the use of Docker

General Information about Docker

Docker is a platform that enables software applications to be packaged and executed within containers. A container bundles the complete application together with all required files, libraries, and configuration settings. This approach ensures that the application operates consistently and reliably across different systems, independent of the underlying infrastructure.    

To run containers, Docker images are used. These are standardized templates and are provided by zapliance or other software vendors via the Docker Hub image repository. From there, they are fetched by the Docker instance on your Linux-based virtual machine / server.

Platform and Licensing Information

This article focuses on the Docker Engine on a modern Linux distribution as the default setup. Its commercial use is free of charge under the open-source Apache License 2.0.

As an alternative to the Docker Engine, container management can also be handled in Podman.

Technical Requirements

  • A dedicated virtual machine (VM) or server needs to be prepared as the host environment. See the Setup Guide Virtual Machine / Server for details.

  • Internet connection for communication with Docker Hub repository.

  • Allow TCP Port 443 through the firewall for communication with Docker Hub repository to fetch latest application releases.


Installation Guide (Linux)

1. Install Docker Engine

On Linux, Docker is installed via the official repository using the terminal. This ensures you always receive the latest security updates.

  • Update Packages: First, update your existing package list: sudo apt-get update

  • Installation: Install the Docker Engine and Docker Compose: sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

  • Verification: Check if the service is running: sudo systemctl status docker

 

2. Grant Necessary Permissions

By default, Docker requires root privileges. To allow your user to run Docker commands without sudo, add your user to the docker group:

  • sudo usermod -aG docker $USER 

Note: You may need to log out and back in for this change to take effect.

 

3. Check and Change Storage Location

Docker stores all data in /var/lib/docker by default. It is essential to ensure that this location has sufficient storage capacity before the first use of Docker.

The disk or partition needs at least 1 TB of free space and should be resizable in the future. Since /var/lib/docker is often located on a smaller system partition, it may be necessary to change the storage location.

 

Check current storage location

Before making any changes, verify where Docker is currently storing data and how much space is available on that partition:

  • Identify the path: Run docker info -f '' to see the current root directory.

  • Check available space: Use the command df -h /var/lib/docker (or your specific path) to check the disk size and usage.

If the current partition already provides 1TB or more of free space and is resizable in the future, no further action is required.

If the partition is too small, you must move the storage location to a larger disk.

 

Change location (if required)

If you need to move the data-root to a larger disk, follow these steps:

  1. Stop Docker: Run sudo systemctl stop docker.

  2. Edit configuration: Open or create the file /etc/docker/daemon.json.

  3. Define new path: Add the "data-root" parameter pointing to your large disk:

    {
    "data-root": "/path/to/your/large/disk/docker"
    }
  4. Restart Docker: Run sudo systemctl start docker to apply the changes.

 

Ready to Run Docker Containers

Now, you are ready to run any Docker image on your system.

See the Basic Docker Commands article to run zapliance solutions.

Or check the zapAnalytics Docker Setup Guide.