Deploy Spug with Docker Compose and Enable Remote Access via cpolar
This guide walks you through installing the lightweight, agent‑less Spug automation platform using Docker Compose, initializing an admin account, and configuring cpolar to expose a stable public address for remote management, covering all required commands and tunnel settings.
Spug is a lightweight, agent‑less automation operations platform designed for small‑to‑medium enterprises, integrating host management, batch execution, online terminal, file upload/download, application deployment, task scheduling, configuration center, monitoring, and alerting.
This tutorial demonstrates installing Spug with Docker Compose and exposing it publicly using cpolar.
1. Install Spug via Docker
Create a docker-compose.yml file with the following content:
version: "3.3"
services:
db:
image: mariadb:10.8.2
container_name: spug-db
restart: always
command: --port 3306 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
- /data/spug/mysql:/var/lib/mysql
environment:
- MYSQL_DATABASE=spug
- MYSQL_USER=spug
- MYSQL_PASSWORD=spug.cc
- MYSQL_ROOT_PASSWORD=spug.cc
spug:
image: openspug/spug-service
container_name: spug
privileged: true
restart: always
volumes:
- /data/spug/service:/data/spug
- /data/spug/repos:/data/repos
ports:
- "80:80"
environment:
- MYSQL_DATABASE=spug
- MYSQL_USER=spug
- MYSQL_PASSWORD=spug.cc
- MYSQL_HOST=db
- MYSQL_PORT=3306
depends_on:
- dbStart the containers: docker compose up -d When the startup logs show success, initialize the admin account (default username admin , password test123 can be changed):
docker exec spug init_spug admin test1232. Local Access Test
Open a browser on the host and visit http://localhost (port 80). If you cannot access it, disable the firewall and ensure the port is open.
3. Install cpolar for Remote Access
Download and install cpolar with the one‑click script:
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bashEnable and start the service:
sudo systemctl enable cpolar
sudo systemctl start cpolarAfter installation, log in to the cpolar web UI and start a tunnel that forwards the local port 80 to a public HTTP address.
4. Configure Spug Public Address in cpolar
In the cpolar dashboard, go to Tunnel Management → Create Tunnel and set:
Tunnel name: any unique name
Protocol: http
Local address: 80
Domain type: random (or reserve a sub‑domain later)
Region: China vip
Click Create to generate the public URL.
5. Access Spug Remotely
Use the generated HTTPS public URL from any device to open the Spug login page, then log in with the admin credentials created earlier.
6. Fix a Stable Public Address
Because the random tunnel URL changes every 24 hours, upgrade the cpolar plan to at least the Basic tier, reserve a sub‑domain, and edit the existing tunnel to use the reserved sub‑domain as the domain type. After updating, the tunnel will show a fixed public address that does not change.
Now you can consistently access Spug via the permanent URL.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
