Server Requirements:
  • Linux server** (Ubuntu 20.04+ recommended)
  • 8GB RAM minimum
  • 4 CPU cores minimum
  • 50GB free disk space
  • Root or sudo access
Domain & Network:
  • Domain name with DNS control
  • Ports 80 and 443 open to the internet
  • SSH access to the server
Software Requirements:
  • Docker and Docker Compose
  • Git
  • NGINX

Installation Steps

1

Server Preparation

Update system packages and install required software:
sudo apt update && sudo apt upgrade -y
Install required packages:
sudo apt install nginx certbot python3-certbot-nginx git -y
Install Docker:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
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
2

Clone and Configure Application

Clone the repository and set up environment:
git clone https://github.com/Weam AI-ai/Weam AI.git
cd Weam AI
cp .env.example .env
Edit the environment file:
nano .env
Update these critical values:
NEXT_PUBLIC_DOMAIN_URL=https://your-domain.com
FRONT_URL=https://your-domain.com
NEXT_PUBLIC_HTTPS_PROTOCOL=true
Replace your-domain.com with your actual domain name.
3

Configure NGINX

Create NGINX configuration:
sudo nano /etc/nginx/sites-available/Weam AI
Add this configuration (replace your-domain.com):
server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://localhost:3000;
        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;
    }

    location /napi/ {
        proxy_pass http://localhost:4050/napi/;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
    }

    location /pyapi/ {
        proxy_pass http://localhost:9089/pyapi/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
Enable the site:
sudo ln -s /etc/nginx/sites-available/Weam AI /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
If nginx -t fails, recheck the config syntax and ensure proper formatting.
4

Install SSL Certificate

Generate Let’s Encrypt certificate:
sudo certbot --nginx -d your-domain.com
Follow the interactive prompts to complete SSL setup. Certbot will automatically modify your NGINX configuration.
Certbot will auto-renew your certificate every 90 days.
5

Build and Start Application

Build and start the services:
bash build.sh
docker compose up -d
This will:
  • Build all Docker images
  • Start services in the background
  • Create necessary containers and networks
6

Verify Deployment

Check that all services are running:
docker compose ps
Test access:
All services should show “Up” status and the website should be accessible via HTTPS.

Troubleshooting

Need help? Reach out via the GitHub issues or Discord Community for faster response.