AI Deployment Guide

    Deploying Bolt.diy on RamNode VPS

    Bolt.diy is an AI-powered development platform that helps you build web applications with natural language. This comprehensive guide walks you through deploying your Bolt.diy applications on a RamNode VPS, including server setup, Node.js configuration, Nginx reverse proxy, and SSL certificate installation.

    Ubuntu 22.04/24.04
    Node.js 20 LTS
    ⏱️ 25-30 minutes

    Prerequisites

    Before starting, ensure you have:

    Server Requirements

    • • RamNode VPS with Ubuntu 22.04/24.04
    • • Minimum 2GB RAM (4GB+ recommended)
    • • 20GB+ SSD storage
    • • Root or sudo access

    Additional Requirements

    • • SSH access credentials
    • • Bolt.diy app ready for deployment
    • • Domain name (optional but recommended)
    • • Basic Linux command knowledge
    2

    Initial Server Setup

    Connect to your RamNode VPS and update the system:

    Connect via SSH
    ssh root@your-vps-ip-address
    Update System Packages
    apt update && apt upgrade -y

    Create a non-root user for security:

    Create User and Grant Permissions
    adduser boltapp
    usermod -aG sudo boltapp
    su - boltapp

    💡 Tip: Replace "your-vps-ip-address" with your actual RamNode VPS IP address.

    3

    Install Node.js and Dependencies

    Install Node.js LTS version (20.x):

    Install Node.js Repository
    curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
    sudo apt install -y nodejs
    Verify Installation
    node --version
    npm --version
    Expected Output
    v20.x.x
    10.x.x

    Install Git for repository management:

    Install Git
    sudo apt install -y git

    ✅ Node.js and Git are now installed and ready.

    4

    Install and Configure Nginx

    Install Nginx web server:

    Install Nginx
    sudo apt install -y nginx
    Configure Firewall
    sudo ufw allow 'Nginx Full'
    sudo ufw allow OpenSSH
    sudo ufw enable
    Verify Nginx Status
    sudo systemctl status nginx

    ⚠️ Important: Make sure OpenSSH is allowed before enabling UFW to prevent losing SSH access!

    5

    Deploy Your Bolt.diy App

    Clone your Bolt.diy application from Git:

    Clone Repository
    cd ~
    git clone https://github.com/yourusername/your-bolt-app.git
    cd your-bolt-app

    Alternatively, upload via SCP from your local machine:

    Upload via SCP (run on local machine)
    scp -r /path/to/your-bolt-app boltapp@your-vps-ip:~/

    Install dependencies and build your app:

    Install and Build
    npm install
    npm run build

    Configure environment variables:

    Create Environment File
    nano .env
    Environment Variables
    NODE_ENV=production
    PORT=3000
    # Add other app-specific variables here

    💡 Tip: Add all necessary API keys and configuration variables to your .env file.

    6

    Set Up PM2 Process Manager

    Install PM2 to manage your Node.js application:

    Install PM2 Globally
    sudo npm install -g pm2
    Start Your Application
    pm2 start npm --name "bolt-app" -- start
    Configure Auto-Start on Boot
    pm2 startup systemd
    pm2 save

    Useful PM2 commands for managing your app:

    PM2 Management Commands
    pm2 status           # Check app status
    pm2 logs bolt-app    # View logs
    pm2 restart bolt-app # Restart app
    pm2 stop bolt-app    # Stop app
    pm2 delete bolt-app  # Remove from PM2

    🚀 Your Bolt.diy app is now running with PM2!

    7

    Configure Nginx Reverse Proxy

    Create an Nginx configuration file for your app:

    Create Nginx Config
    sudo nano /etc/nginx/sites-available/bolt-app
    Nginx Configuration
    server {
        listen 80;
        server_name your-domain.com www.your-domain.com;
    
        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_cache_bypass $http_upgrade;
            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;
        }
    }

    Enable the site and restart Nginx:

    Enable Site
    sudo ln -s /etc/nginx/sites-available/bolt-app /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl restart nginx

    💡 Tip: Replace "your-domain.com" with your actual domain name.

    8

    Set Up SSL with Let's Encrypt

    Install Certbot for SSL certificate management:

    Install Certbot
    sudo apt install -y certbot python3-certbot-nginx
    Obtain SSL Certificate
    sudo certbot --nginx -d your-domain.com -d www.your-domain.com

    Follow the prompts and Certbot will automatically configure SSL for your domain.

    Test Auto-Renewal
    sudo certbot renew --dry-run

    🔒 Your site is now secured with HTTPS! Certificates will auto-renew.

    9

    Monitoring and Logging

    Monitor your application and server health:

    View Application Logs
    pm2 logs bolt-app --lines 100
    View Nginx Logs
    sudo tail -f /var/log/nginx/access.log
    sudo tail -f /var/log/nginx/error.log
    Monitor System Resources
    htop              # Install: sudo apt install htop
    pm2 monit         # PM2's built-in monitor

    Set up PM2 monitoring dashboard (optional):

    PM2 Monitoring
    pm2 monitor

    💡 Tip: Regularly check logs to identify and resolve issues quickly.

    10

    Troubleshooting

    Common issues and solutions:

    🎉 Deployment Complete!

    Your Bolt.diy application is now live on RamNode VPS with SSL, process management, and monitoring in place. Your AI-powered development platform is ready to serve users securely and efficiently.