Self-Hosted Deployment
Full control on your own infrastructure
Deploy ATStatus on your own VPS, dedicated server, or on-premises infrastructure. Self-hosting gives you complete control over your data and deployment configuration.
Requirements
Node.js 18+
Runtime environment for the application
PM2 or systemd
Process manager for auto-restart and monitoring
Reverse Proxy
NGINX or Caddy for SSL and load balancing
SSL Certificate
Let's Encrypt or commercial certificate
Hardware Recommendations
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2+ vCPUs |
| RAM | 1 GB | 2 GB+ |
| Storage | 10 GB SSD | 20 GB+ SSD |
| OS | Ubuntu 22.04 LTS, Debian 12, or RHEL 9 | |
Setup Steps
1
Clone Repository
Download the ATStatus source code from GitHub
2
Install Dependencies
Run npm ci to install production dependencies
3
Configure Environment
Set up your .env file with required variables
4
Initialize Database
Generate Prisma client and run migrations
5
Build Application
Create optimized production build
6
Start with PM2
Launch with process manager for reliability
Server Setup
# Clone repository
git clone https://github.com/your-org/atstatus.git
cd atstatus
# Install dependencies
npm ci --production
# Configure environment
cp .env.example .env
nano .env
# Generate Prisma client
npx prisma generate
# Run migrations
npx prisma migrate deploy
# Build application
npm run buildPM2 Process Manager
PM2 is recommended for production deployments. It provides:
- Auto-restart on crash or reboot
- Log management and rotation
- CPU and memory monitoring
- Cluster mode for multi-core usage
- Zero-downtime reloads
# Install PM2 globally
npm install -g pm2
# Create ecosystem file
cat > ecosystem.config.js << 'EOF'
module.exports = {
apps: [{
name: 'atstatus',
script: 'npm',
args: 'start',
cwd: '/opt/atstatus',
env: {
NODE_ENV: 'production',
PORT: 3000
},
instances: 1,
autorestart: true,
max_memory_restart: '1G'
}]
}
EOF
# Start application
pm2 start ecosystem.config.js
# Save PM2 configuration
pm2 save
# Enable startup on boot
pm2 startupNGINX Configuration
server {
listen 80;
server_name status.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name status.example.com;
ssl_certificate /etc/letsencrypt/live/status.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/status.example.com/privkey.pem;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}Don't forget to set
TRUST_PROXY="true" in your .env when using a reverse proxy.Security Checklist
Before going live, ensure your server is properly secured.
- Firewall configured (only ports 80/443 open)
- SSH key authentication enabled
- Fail2ban or similar installed
- Automatic security updates enabled
- Strong passwords for all accounts
SSL with Certbot
# Install Certbot
sudo apt install certbot python3-certbot-nginx
# Obtain certificate
sudo certbot --nginx -d status.example.com
# Auto-renewal is configured automatically
# Test renewal with:
sudo certbot renew --dry-run