Prerequisites
Before starting, ensure you have:
Server Requirements
- • RamNode VPS (Ubuntu 24.04+)
- • SSH access to server with sudo privileges
- • Domain name pointed to VPS IP
Application Requirements
- • Leap.New application ready for deployment
- • Basic Linux command line knowledge
- • Understanding of web deployment basics
Initial Server Setup
Connect to your RamNode VPS and update the system:
ssh root@your-server-ipapt update && apt upgrade -yCreate a dedicated user for your application:
adduser leapapp
usermod -aG sudo leapapp
su - leapapp💡 Tip: Replace "your-server-ip" with your actual RamNode VPS IP address.
Install Required Dependencies
Install Node.js, Git, and PM2 for your Leap.New application:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejsnode --version
npm --versionsudo apt install git -y
sudo npm install -g pm2✅ All dependencies are now installed and ready for deployment.
Configure Firewall
Configure UFW firewall to secure your server:
sudo ufw allow ssh
sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable
sudo ufw status⚠️ Warning: Make sure SSH is allowed before enabling UFW to avoid losing access!
Install and Configure Nginx
Install Nginx as a reverse proxy for your Leap.New application:
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginxCreate Nginx configuration for your domain:
sudo nano /etc/nginx/sites-available/leapappAdd the following configuration (replace your-domain.com with your actual domain):
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_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;
}
}sudo ln -s /etc/nginx/sites-available/leapapp /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginxDeploy Your Leap.New Application
Clone and prepare your Leap.New application for deployment:
cd ~
git clone https://github.com/yourusername/your-leap-app.git
cd your-leap-appnpm installCreate environment configuration:
nano .envNODE_ENV=production
PORT=3000
DATABASE_URL=your_database_url
API_KEY=your_api_key
# Add other Leap.New specific variablesnpm run build🔧 Note: Replace repository URL and environment variables with your actual values.
Set Up SSL with Let's Encrypt
Secure your application with SSL certificates:
sudo apt install certbot python3-certbot-nginx -ysudo certbot --nginx -d your-domain.com -d www.your-domain.com🔒 Certbot will automatically configure SSL and update your Nginx configuration for HTTPS.
Start Your Application with PM2
Configure PM2 to manage your application process:
nano ecosystem.config.jsmodule.exports = {
apps: [{
name: 'leap-app',
script: 'npm',
args: 'start',
cwd: '/home/leapapp/your-leap-app',
env: {
NODE_ENV: 'production',
PORT: 3000
},
instances: 'max',
exec_mode: 'cluster',
watch: false,
max_memory_restart: '1G',
error_file: './logs/err.log',
out_file: './logs/out.log',
log_file: './logs/combined.log',
time: true
}]
}mkdir logs
pm2 start ecosystem.config.js
pm2 save
pm2 startup🚀 Your Leap.New application is now running with PM2 process management!
Database Setup (if required)
Set up a database if your Leap.New application requires one:
PostgreSQL Option
sudo apt install postgresql postgresql-contrib -y
sudo systemctl start postgresql
sudo systemctl enable postgresqlMongoDB Option
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt update && sudo apt install -y mongodb-orgsudo -u postgres psql
CREATE DATABASE leapapp_db;
CREATE USER leapapp_user WITH PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE leapapp_db TO leapapp_user;
\qMonitoring and Maintenance
Set up monitoring and maintenance for your application:
sudo nano /etc/logrotate.d/leapapp/home/leapapp/your-leap-app/logs/*.log {
daily
missingok
rotate 52
compress
notifempty
create 644 leapapp leapapp
postrotate
pm2 reloadLogs
endscript
}pm2 monit
pm2 logs leap-app
pm2 statusCreate automated backup script:
nano ~/backup.sh#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/home/leapapp/backups"
APP_DIR="/home/leapapp/your-leap-app"
mkdir -p $BACKUP_DIR
tar -czf $BACKUP_DIR/app_backup_$DATE.tar.gz -C $APP_DIR .
pg_dump -U leapapp_user -h localhost leapapp_db > $BACKUP_DIR/db_backup_$DATE.sql
find $BACKUP_DIR -name "*.tar.gz" -mtime +7 -deletechmod +x ~/backup.sh
crontab -e
# Add: 0 2 * * * /home/leapapp/backup.shPerformance Optimization
Optimize your deployment for better performance:
sudo nano /etc/nginx/nginx.confgzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private must-revalidate auth;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;Add caching headers to your Nginx server block:
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 1M;
add_header Cache-Control "public, immutable";
}// In your ecosystem.config.js
node_args: ['--max-old-space-size=2048']⚡ These optimizations will improve your application's loading speed and reduce server load.
Troubleshooting Common Issues
Common issues and their solutions:
Application Not Starting
pm2 logs leap-app
pm2 status
npm install
ls -la /home/leapapp/your-leap-appNginx 502 Bad Gateway
pm2 status
sudo nginx -t
sudo tail -f /var/log/nginx/error.logSSL Certificate Problems
sudo certbot certificates
sudo certbot renew --dry-run
sudo ufw statusSecurity Best Practices
Essential security practices for production deployment:
- Regular Updates: Keep Ubuntu, Node.js, and all packages updated
- Fail2Ban: Install fail2ban to prevent brute force attacks
- SSH Keys: Disable password authentication for SSH
- Firewall Rules: Only allow necessary ports (22, 80, 443)
- Regular Backups: Automate backups and test restore procedures
- Monitor Logs: Set up log monitoring and alerts for security events
🔒 Security Tip: Regularly audit your server, use strong passwords, and keep backups in multiple locations.
Deployment Complete!
🎉 Congratulations! You've successfully deployed your Leap.New application on a RamNode VPS with Ubuntu 24+. This setup provides you with full control over your hosting environment while leveraging the power of AI-driven development.
Your application now runs efficiently, securely, and can scale as your needs grow. The combination of Nginx, PM2, SSL encryption, and proper monitoring ensures a production-ready environment.
💡 Next Steps: Monitor your application's performance, keep your system updated, and maintain regular backups. Consider setting up monitoring alerts and scaling your infrastructure as your user base grows.
