Skip to main content
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/weam.git
cd weam
cp .env.example .env
Edit the environment file:
nano .env
Update these critical values:
NEXT_PUBLIC_DOMAIN_URL=https://yourexampledomain.com
FRONT_URL=https://yourexampledomain.com
NEXT_PUBLIC_HTTPS_PROTOCOL=true
Replace yourexampledomain.com with your actual domain name.
3

Configure NGINX

Create NGINX configuration:
sudo nano /etc/nginx/sites-available/yourapp
Add this configuration (replace yourexampledomain.com):
server {
    listen 80;
    server_name yourexampledomain.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';
    }
}
Enable the site:
sudo ln -s /etc/nginx/sites-available/yourapp /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 yourexampledomain.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

Check these items:
  • Verify DNS records point to your server IP
  • Confirm firewall allows ports 80 and 443
  • Ensure NGINX is running: sudo systemctl status nginx
  • Test local access: curl -I http://localhost:3000
Common solutions:
# Check NGINX status
sudo systemctl status nginx

# Restart NGINX
sudo systemctl restart nginx

# Check firewall
sudo ufw status
Common causes:
  • Domain DNS not fully propagated
  • Domain ownership verification failed
  • NGINX configuration syntax errors
Solutions:
# Check certificate status
sudo certbot certificates

# Renew certificate manually
sudo certbot renew --dry-run

# Check NGINX config
sudo nginx -t
Debugging steps:
  • Check Docker container logs: docker compose logs
  • Verify environment variables are set correctly
  • Ensure all required services are running
  • Check port conflicts
Common commands:
# View all logs
docker compose logs

# Check specific service
docker compose logs frontend

# Restart services
docker compose restart
Error
  • Error response from daemon: pull access denied for <image-name>, repository does not exist or may require 'docker login'
Solutions
  • Clear Docker Build Cache and Rebuild
  • Remove all Docker build cache and images
  • Run the following command to clear all cached layers and build data: docker builder prune -a -f
  • This command removes all unused build cache and intermediate images, ensuring a clean environment.
  • Rebuild the application from scratch
Need help? Reach out via the GitHub issues or Discord Community for faster response.