访问 Ghost 管理后台
URL: https://<server-ip>/ghost
完成初始配置:创建管理员账号并设置站点信息。
通过 Docker Compose 管理 Ghost
cd /root/ghost docker compose ps # View running containers docker compose up -d # Start Ghost docker compose down # Stop Ghost docker compose restart # Restart Ghost
Credentials & Configuration
配置文件存储于 /root/ghost/.env 和 /root/ghost/docker-compose.yml。
Email Setup
Uncomment mail section in /root/ghost/docker-compose.yml.
Restart containers:
cd /root/ghost; docker compose restart
请确保已开启 SMTP 访问权限。
以 Gmail 应用专用密码为例:
mail__transport: SMTP mail__options__host: smtp.gmail.com mail__options__port: 465 mail__options__secure: true mail__options__auth__user: [email protected] mail__options__auth__pass: your-app-password
Domain & SSL
将你的域名指向服务器 IP。
Update /root/ghost/docker-compose.yml 将 URL 更新为域名(url: https://your-domain)。
Restart containers:
cd /root/ghost; docker compose restart
关于 Certbot SSL:
apt install -y certbot python3-certbot-nginx certbot certonly --nginx --non-interactive --agree-tos --email <your-email> -d <your-domain>
替换以下文件中的 SSL 路径 /etc/nginx/sites-enabled/ghost.
# Example ssl_certificate /etc/letsencrypt/live/your-domain/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/your-domain/privkey.pem;
Reload Nginx:
nginx -t && systemctl reload nginx