Skip to main content
Version: 3.x

Docker Installing

Requirement Environment

  • Docker
  • Modern browser

Install Steps

The flow of installation is based on Centos7.x.

1. Install docker

Warning

if you have installed docker, you can skip this step.

The following steps are for Centos, please refer to Docker Official Document for other systems.

yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-compose-plugin
systemctl enable docker
systemctl start docker

2. Create docker-compose.yml

vi docker-compose.yml
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:
# if port 80 is occupied, you can replace it with other ports, such as: - "8000:80"
- "80:80"
environment:
- MYSQL_DATABASE=spug
- MYSQL_USER=spug
- MYSQL_PASSWORD=spug.cc
- MYSQL_HOST=db
- MYSQL_PORT=3306
depends_on:
- db

3. Start container

docker compose up -d
warning

docker-compose install method is different, you may also need to execute docker-compose up -d

4. Initialization

The following operation will create an administrator account with the user name admin and password spug.dev, you can replace the administrator account/password by yourself.

docker exec spug init_spug admin spug.dev

5. Access test

Enter http://localhost:80 in the browser to access (the default account password is set in step 4).

6. Version upgrade

You can view the current running Spug version in System Management/System Settings/About, you can view the current latest version in Update Log, if you need to upgrade Spug, please refer to Version Upgrade Document.