---
title: Basic Docker Commands (Linux)
description: Most important Docker commands for Linux to run, remove and update containers and images.
---

[Skip to content](https://knowledge.zapliance.com/basic-docker-commands#main-content)

English

Show submenu for translations

[![zapliance logo light bg](https://knowledge.zapliance.com/hubfs/zapliance%20logo%20light%20bg.svg)](https://knowledge.zapliance.com/migration)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations
- [Contact us](https://zapliance.com/support/)

[Contact us](https://zapliance.com/support/)

 Hi. How can we help?

- There are no suggestions because the search field is empty.

1. [Knowledge Base](https://knowledge.zapliance.com/)
2. [Technical Onboarding](https://knowledge.zapliance.com/technical-onboarding)
3. [Docker](https://knowledge.zapliance.com/technical-onboarding#docker)

# Basic Docker Commands (Linux)

## This article explains how to use essential Docker commands

### General usage of Docker

On Linux, Docker operates as a background service (daemon) and is managed exclusively through the **Command Line Interface (CLI)**. While graphical tools exist, the CLI is the standard and most powerful way to interact with Docker. It allows for quick command execution, easy automation, and precise control over container environments. This is particularly important when deploying complex multi-container applications like **zapAnalytics** using **Docker Compose**.

 

#### Topics:

- [Basic Docker CLI Commands](https://knowledge.zapliance.com/basic-docker-commands#basic-cli)
- [Common Docker Compose Commands](https://knowledge.zapliance.com/basic-docker-commands#common-compose)
- [Quick Start to Run zapliance Docker Images](https://knowledge.zapliance.com/basic-docker-commands#run-zapAnalytics-in-docker)
- [Update a Docker Image](https://knowledge.zapliance.com/basic-docker-commands#update-image)

### Basic Docker CLI Commands

Docker is accessed via the `docker` and `docker compose` commands. Open your terminal and type the commands directly.

Depending on your installation, you may need to prefix commands with `sudo` unless your user is part of the `docker` group. We recommend adding your user to the `docker` group with `sudo usermod -aG docker $USER` after installing the Docker Engine.

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

| **Command** | **Description** | **Example** |
| --- | --- | --- |
| `docker --version` | Show installed Docker version |  |
| `docker pull <image>` | Download a Docker image from Docker Hub | `docker pull docker.io/zapliance/zapAnalytics:2.0.0` |
| `docker images` | List all locally stored images |  |
| `docker ps -a` | List all containers (running and stopped) |  |
| `docker rm <container_id>` | Remove a container | `docker rm 123abc` |
| `docker rmi <image_id>` | Remove an image | `docker rmi zapliance/zapAnalytics:2.0.0` |
| `docker logs <container_id>` | View container logs | `docker logs 123abc` |
| `docker stop <container_id>` | Stops a specific container | `docker stop application_zapanalytics` |

### Common Docker Compose Commands

`docker compose` is a tool for defining and managing multi-container applications with a YAML file (`docker-compose.yml`). It simplifies running linked containers with a single command.

| **Command** | **Description** |
| --- | --- |
| `docker compose up` | Build, (re)create, and start containers defined in the YAML file |
| `docker compose up -d` | Start containers in detached mode (runs in the background) |
| `docker compose pull` | Download the latest versions of the images defined in the YAML file |
| `docker compose stop` | Stop the running containers without removing them. |
| `docker compose down` | Stop & remove containers and networks created by `up` |
| `docker compose logs -f` | Follow the live log output of all services defined in the YAML file |

 

### Quick Start: Runing zapliance Docker Images

zapliance will provide a docker-compose.yml file with default configuration during the onboarding. You can then use basic Docker commands to deploy it.

First, open the command line and navigate to the folder where the docker-compose.yml file has been placed:

- Change directory in command line (example, please choose the appropriate directory):  
  `cd /opt/zapAnalytics`
- Start the container: `docker compose up -d`

- Docker fetches/downloads all required images from the remote image registries. (you may copy these images to your own image registry beforehand and incorporate it to your deployment pipelines)
- After 10-30 seconds you should be able to access the start page in the web browser
- Check if container is running properly: `docker ps -a`
- Stop and remove container: `docker compose down`
- Remove image: `docker rmi <image_name>`
- Add -f to force removal: `docker rmi -f <image_name>`

### Update a Docker Image

To update a Docker image, follow these steps:

1. **Edit your YAML file**

   Open `docker-compose.yml` and change the image tag to the desired version, for example:
   
   services:  
     zapanalytics:  
       image: zapliance/zapanalyticsplatform-prod:**2.0.0**  
       container\_name: application\_zapanalytics  
       restart: always
   
   ...
2. **Pull the new image and restart**
   
   On Linux, Docker Compose handles the update process efficiently:
   
     - `docker compose pull`
     - `docker compose up -d`
   
   Docker will automatically download the new version while the old container is still running, then stop the old container, and start a new one using the updated image.

 

### **Force Update**

If a standard update fails or if you encounter persistent configuration issues, you can perform a "clean" update.

**Note:** This will cause longer downtime because the old container is stopped first, then the image is deleted and the update downloaded.

1. **Edit your YAML file as described above**
2. **Stop & remove old containers and images**

     - `docker compose down`
     - `docker rmi -f zapliance/zapanalyticsplatform-prod:<version>`
   
   Replace `<version>` with the current tag (e.g., `2.0.0`).
3. **Start the updated container**  
     - `docker compose up -d`

The container will now run the updated image version.

---

#### Resources for Further Learning

- Docker documentation: [https://docs.docker.com/](https://docs.docker.com/)
- Docker Compose documentation: [https://docs.docker.com/compose/](https://docs.docker.com/compose/)

- [Overview Agentic Teams](https://knowledge.zapliance.com/overview-agentic-teams)
- [Product Descriptions](https://knowledge.zapliance.com/product-descriptions#main-content)

    - [Platforms](https://knowledge.zapliance.com/product-descriptions#platforms)
    - [Agentic Teams](https://knowledge.zapliance.com/product-descriptions#agentic-teams)
    - [Agentic Team Solutions](https://knowledge.zapliance.com/product-descriptions#agentic-team-solutions)
    - [Solution Bundles](https://knowledge.zapliance.com/product-descriptions#solution-bundles)
    - [Customer Success](https://knowledge.zapliance.com/product-descriptions#customer-success)
- [Technical Onboarding](https://knowledge.zapliance.com/technical-onboarding#main-content)

    - [zapHome](https://knowledge.zapliance.com/technical-onboarding#zaphome)
    - [Virtual Machine/Server](https://knowledge.zapliance.com/technical-onboarding#virtual-machine-server)
    - [Docker](https://knowledge.zapliance.com/technical-onboarding#docker)
    - [zapAnalytics Setup Guides](https://knowledge.zapliance.com/technical-onboarding#zapanalytics-setup-guides)
    - [SAP Setup Guides](https://knowledge.zapliance.com/technical-onboarding#sap-setup-guides)
    - [LibreChat Setup Guide](https://knowledge.zapliance.com/technical-onboarding#librechat-setup-guide)
    - [Microsoft Services Setup Guides](https://knowledge.zapliance.com/technical-onboarding#microsoft-services-setup-guides)
    - [Former Setups](https://knowledge.zapliance.com/technical-onboarding#former-setups)
- [Functional Onboarding](https://knowledge.zapliance.com/functional-onboarding#main-content)

    - [Project Workflows](https://knowledge.zapliance.com/functional-onboarding#project-workflows)
    - [zapAnalytics User Guides](https://knowledge.zapliance.com/functional-onboarding#zapanalytics-user-guides)
    - [Wilma User Guides](https://knowledge.zapliance.com/functional-onboarding#wilma-user-guides)
    - [SAP User Guides](https://knowledge.zapliance.com/functional-onboarding#sap-user-guides)
    - [Microsoft Services User Guides](https://knowledge.zapliance.com/functional-onboarding#microsoft-services-user-guides)
- [Governance Onboarding](https://knowledge.zapliance.com/governance-onboarding#main-content)

    - [General Governance Information](https://knowledge.zapliance.com/governance-onboarding#general-governance-information)
    - [Digital Audit Preparation (DAP)](https://knowledge.zapliance.com/governance-onboarding#digital-audit-preparation-dap)
    - [Cash Recovery AI (CRAI)](https://knowledge.zapliance.com/governance-onboarding#cash-recovery-ai-crai)

[![Favikon Color-1](https://knowledge.zapliance.com/hs-fs/hubfs/Favikon%20Color-1.png?width=30&height=30&name=Favikon%20Color-1.png "Favikon Color-1")](https://zapliance.com/)

Knowledge Base

Copyright © 2026, zapliance GmbH