181 words
1 minute
Installing Docker & Docker Compose(China)

This guide covers both online and air-gapped (offline) installation methods for Docker and Docker Compose on Linux systems. It is intended for users who need to deploy in restricted intranet environments or environments without external internet access.

🌐 Online Installation#

Method 1: Official Script & Manual Compose Download#

Terminal window
curl -fsSL https://get.docker.com -o get-docker.shsh
get-docker.sh
sudo apt-get install libffi-dev libssl-dev。
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Method 2: Using Mirror Scripts (Optimized for specific regions)#

Terminal window
bash <(curl -sSL https://linuxmirrors.cn/docker.sh)

πŸ“¦ Offline Installation (Air-gapped)#

  1. Download Binaries Download the required packages on a machine with internet access:
# Docker Static Binary
wget https://download.docker.com/linux/static/stable/x86_64/docker-24.0.6.tgz
# Docker Compose Binary
wget https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64
  1. Extract and Install Docker Transfer the files to the target machine, then execute:
Terminal window
tar -xvzf docker-24.0.6.tgz
sudo cp docker/* /usr/bin/
  1. Configure Systemd Service Create a service unit file to manage the Docker daemon:
Terminal window
sudo tee /etc/systemd/system/docker.service > /dev/null <<EOF
[Unit]
Description=Docker Application Container Engine
After=network.target
[Service]
ExecStart=/usr/bin/dockerd
Restart=always
[Install]
WantedBy=multi-user.target
EOF
# Reload configuration and enable the service
sudo systemctl daemon-reload
sudo systemctl enable docker
sudo systemctl start docker
  1. Install Docker Compose
Terminal window
sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
  1. Verify Installation
Terminal window
docker -v
docker-compose -v
Installing Docker & Docker Compose(China)
https://fuwari.vercel.app/posts/ec661856-ac41-4faa-9c35-33405bb802b1/
Author
Ryan Zhang
Published at
2025-06-14
License
CC BY-NC-SA 4.0
This content has been translated with the assistance of AI tools, including ChatGPT, Gemini, and Qwen. While efforts have been made to ensure accuracy and clarity, minor discrepancies may exist. Please refer to the original text for authoritative interpretation if needed.