Skip to content

One-Click Script Install

The one-click script is the recommended way to deploy OpsAnt. It automatically completes image pulling, container orchestration, random password generation, and full service startup via install/opsant-install.sh.

Install Process

1. Install Docker and Dependencies

# Ubuntu / Debian 示例
sudo apt-get -y update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt-get -y install docker-ce jq uuid wget git ntpdate mysql-client unzip
systemctl enable --now docker

2. Get the Code

cd /opt && git clone https://github.com/unixhot/opsant.git
# 或下载源码包并解压到 /opt/opsant

3. Modify Install Configuration

cd /opt/opsant/install
cp install.config.example install.config
vim install.config

Key configuration items:

Configuration Item Description
INSTALL_PATH Data directory, default /data/opsant
DOMAIN_NAME Access address (IP or resolvable domain)
LOCAL_IP Local intranet IP
PROXY_PUBLIC_IP Public IP (keep default for intranet deployment)
PAAS_DOCKER_REG Image repository (default Alibaba Cloud)

4. Run the Install Script

cd /opt/opsant/install && ./opsant-install.sh install

What the Script Does

  1. Check and initialize the directory structure
  2. Pull OpsAnt and dependency images
  3. Start containers such as MySQL, Redis, Consul, Prometheus, Alertmanager, blackbox-exporter, etc.
  4. Deploy the Proxy main container (Django + Celery + SaltStack + OpsMini Server)
  5. Generate random passwords:
  6. admin login password
  7. MySQL / Redis password
  8. OpsMini Token
  9. Prometheus Basic Auth password
  10. Automatically write Prometheus access configuration and import built-in alert rules

Install Complete

The script will output key information, for example:

OpsAnt Web 登录账号:admin  初始密码:<随机密码>(请登录后立即修改)

Be sure to save the random passwords. If you forget the password, you can enter the container via docker exec to reset it.

Verification

# 查看容器状态
docker ps | grep opsany

# 查看平台进程
docker exec opsany-proxy-opsant supervisorctl status

Uninstall

If the install fails or you need to reinstall, run:

cd /opt/opsant/install && ./opsant-uninstall.sh

FAQ

  • Port already in use: Change the mapped port or stop the service occupying it
  • Image pull failed: Check external network connectivity, or configure a domestic image accelerator
  • Access address loops back to the login page: The access address is inconsistent with the configured DOMAIN_NAME, they must be kept consistent