Prerequisites
- RamNode VPS account with a provisioned server
- SSH access to your VPS
- Domain name (optional, but recommended)
- Base44 application code repository
Recommended VPS Plans
For optimal Base44 application performance, we recommend:
Standard VPS
Perfect for development and small production deployments
Premium VPS
Best for production workloads with high traffic
Initial Server Setup
Connect to Your VPS
ssh root@your_server_ipUpdate System Packages
apt update && apt upgrade -yCreate a Non-Root User
adduser base44deploy
usermod -aG sudo base44deploySet Up SSH Key Authentication (Recommended)
On your local machine:
ssh-copy-id base44deploy@your_server_ipInstall Required Dependencies
Install Node.js and npm
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejsVerify installation:
node --version
npm --versionInstall Git
sudo apt install -y gitInstall PM2 (Process Manager)
sudo npm install -g pm2Install Nginx (Web Server)
sudo apt install -y nginxConfigure Firewall
Configure UFW firewall to secure your VPS while allowing necessary traffic:
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enableDeploy Your Base44 Application
Clone Your Repository
cd /home/base44deploy
git clone https://github.com/yourusername/your-base44-app.git
cd your-base44-appInstall Application Dependencies
npm installSet Up Environment Variables
Create a .env file:
nano .envAdd your environment variables:
NODE_ENV=production
PORT=3000
DATABASE_URL=your_database_connection_string
API_KEY=your_api_keyBuild Your Application (if needed)
npm run buildStart Application with PM2
pm2 start npm --name "base44-app" -- start
pm2 save
pm2 startupThis ensures your app restarts automatically after server reboots.
Configure Nginx as Reverse Proxy
Create Nginx Configuration
sudo nano /etc/nginx/sites-available/base44-appAdd the following 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
sudo ln -s /etc/nginx/sites-available/base44-app /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginxSet Up SSL with Let's Encrypt
Install Certbot
sudo apt install -y certbot python3-certbot-nginxObtain SSL Certificate
sudo certbot --nginx -d your_domain.com -d www.your_domain.comFollow the prompts to complete SSL setup. Certbot will automatically configure Nginx for HTTPS.
Set Up Auto-Renewal
sudo certbot renew --dry-runDatabase Setup (if applicable)
Install PostgreSQL
sudo apt install -y postgresql postgresql-contribCreate Database and User
sudo -u postgres psql
CREATE DATABASE base44_db;
CREATE USER base44_user WITH ENCRYPTED PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE base44_db TO base44_user;
\qUpdate your .env file with the database connection string.
Monitoring and Maintenance
Monitor Application with PM2
pm2 status
pm2 logs base44-app
pm2 monitSet Up Log Rotation
PM2 handles log rotation automatically, but you can configure it:
pm2 install pm2-logrotate
pm2 set pm2-logrotate:max_size 10M
pm2 set pm2-logrotate:retain 7Monitor Server Resources
htop
df -h
free -mDeployment Updates
Pull latest changes and restart:
cd /home/base44deploy/your-base44-app
git pull origin main
npm install
npm run build
pm2 restart base44-appAutomated Deployment Script
Create a deployment script (deploy.sh):
#!/bin/bash
cd /home/base44deploy/your-base44-app
git pull origin main
npm install
npm run build
pm2 restart base44-app
echo "Deployment completed successfully!"Make it executable:
chmod +x deploy.shDatabase Backups
Create a backup script (backup.sh):
#!/bin/bash
BACKUP_DIR="/home/base44deploy/backups"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
pg_dump -U base44_user base44_db > $BACKUP_DIR/db_backup_$DATE.sql
find $BACKUP_DIR -name "db_backup_*.sql" -mtime +7 -deleteSchedule with cron:
0 2 * * * /home/base44deploy/backup.shTroubleshooting
Application Won't Start
Check PM2 logs:
pm2 logs base44-app --lines 100Nginx Configuration Issues
Test configuration:
sudo nginx -tCheck error logs:
sudo tail -f /var/log/nginx/error.logPort Already in Use
Find process using the port:
sudo lsof -i :3000Database Connection Issues
Verify PostgreSQL is running:
sudo systemctl status postgresqlTest connection:
psql -U base44_user -d base44_db -h localhostSecurity Best Practices
- Keep system packages updated regularly
- Use strong passwords and SSH keys
- Configure fail2ban to prevent brute force attacks
- Regularly backup your data
- Monitor server logs for suspicious activity
- Keep Node.js and application dependencies updated
- Use environment variables for sensitive data
- Implement rate limiting in your application
Additional Resources
Ready to Deploy Base44?
Your Base44 application should now be successfully deployed and running on your RamNode VPS!
