Complete installation and configuration guide for running ContentWing on Linux servers. Includes Docker and native installation methods with security best practices.
Ensure your Linux server meets these requirements before installation:
| Component | Minimum | Recommended | Notes |
|---|---|---|---|
| Operating System | Ubuntu 18.04+ / CentOS 7+ / Debian 9+ | Ubuntu 20.04 LTS / CentOS 8+ / Debian 11 | Any modern Linux distribution with systemd support |
| CPU | 2 cores, 2.0 GHz | 4+ cores, 2.5+ GHz | ARM64 and x86_64 architectures supported |
| Memory (RAM) | 4 GB | 8+ GB | More RAM improves AI processing performance |
| Storage | 20 GB free space | 50+ GB SSD | SSD recommended for database performance |
| Network | Stable internet connection | 100+ Mbps bandwidth | Required for social media API communications |
Select the installation method that best fits your needs and expertise:
Quick setup using Docker containers
Setup time: 15 minutes
Direct installation on Linux system
Setup time: 30-45 minutes
Follow these steps for a quick Docker-based installation:
# Update package index
sudo apt update
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Add user to docker group
sudo usermod -aG docker $USER
# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose# Create application directory
mkdir -p ~/contentwing && cd ~/contentwing
# Download docker-compose.yml
curl -O https://releases.contentwing.com/latest/docker-compose.yml
# Download environment template
curl -O https://releases.contentwing.com/latest/.env.example
cp .env.example .env# Edit environment file
nano .env
# Required settings:
# APP_URL=https://your-domain.com
# DATABASE_URL=postgresql://user:pass@db:5432/contentwing
# JWT_SECRET=your-super-secret-key
# REDIS_URL=redis://redis:6379# Start all services
docker-compose up -d
# Check service status
docker-compose ps
# View logs
docker-compose logs -f appFor advanced users who prefer direct system installation:
# Update system packages
sudo apt update && sudo apt upgrade -y
# Install Node.js 18+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install PostgreSQL
sudo apt install postgresql postgresql-contrib -y
# Install Redis
sudo apt install redis-server -y
# Install Nginx (optional, for reverse proxy)
sudo apt install nginx -y# Switch to postgres user
sudo -u postgres psql
# Create database and user (in PostgreSQL shell)
CREATE DATABASE contentwing;
CREATE USER contentwing_user WITH PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE contentwing TO contentwing_user;
\q
# Test connection
psql -h localhost -U contentwing_user -d contentwing# Create application directory
sudo mkdir -p /opt/contentwing
sudo chown $USER:$USER /opt/contentwing
cd /opt/contentwing
# Download latest release
curl -L https://releases.contentwing.com/latest/contentwing-linux.tar.gz | tar xz
# Install dependencies
npm install --production
# Copy configuration template
cp .env.example .env# Edit configuration
nano .env
# Run database migrations
npm run db:migrate
# Create systemd service
sudo cp contentwing.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable contentwing
sudo systemctl start contentwingSecure your ContentWing installation with these essential security measures:
Configure Nginx as a reverse proxy for better performance and SSL termination:
server {
listen 80;
server_name your-domain.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name your-domain.com;
ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your-domain.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;
}
}1. Save this config to /etc/nginx/sites-available/contentwing
2. Create symlink: sudo ln -s /etc/nginx/sites-available/contentwing /etc/nginx/sites-enabled/
3. Test config: sudo nginx -t
4. Reload Nginx: sudo systemctl reload nginx
Keep your ContentWing installation healthy with these monitoring tools:
Monitor server resources and performance
# Install htop for process monitoring
sudo apt install htop
# Install iotop for disk I/O monitoring
sudo apt install iotop
# Monitor ContentWing logs
sudo journalctl -u contentwing -fMonitor PostgreSQL performance
# Check database connections
sudo -u postgres psql -c "SELECT * FROM pg_stat_activity;"
# Monitor database size
sudo -u postgres psql -c "SELECT pg_size_pretty(pg_database_size('contentwing'));"
# Check slow queries
sudo nano /etc/postgresql/*/main/postgresql.confdocker-compose up -d - Start servicesdocker-compose down - Stop servicesdocker-compose logs -f - View logsdocker-compose pull && docker-compose up -d - Updatesudo systemctl status contentwing - Check statussudo systemctl restart contentwing - Restart servicesudo journalctl -u contentwing -f - View logscd /opt/contentwing && npm update - Update appAnother service is using port 3000.
sudo lsof -i :3000 - Find process using portsudo kill -9 PID - Kill process by PIDCannot connect to PostgreSQL database.
sudo systemctl status postgresql - Check PostgreSQL statussudo systemctl start postgresql - Start PostgreSQLsudo -u postgres psql -c "SELECT version();" - Test connectionHTTPS not working or certificate expired.
sudo certbot renew - Renew certificatessudo nginx -t - Test Nginx configurationsudo systemctl reload nginx - Reload NginxYour Linux server is now ready! Continue with these guides:
Your ContentWing server is now running on Linux. Start creating amazing content!