How to Install Moltbot on a VPS (Step-by-Step Guide)
How to Install Moltbot on a VPS (Step-by-Step Guide)
If you want Moltbot to run 24/7, stay online permanently, and be accessible from anywhere, deploying it on a VPS is the most reliable solution.
Local setups are fine for testing, but once you need stability, uptime, and remote access, a VPS-based deployment becomes the real answer.
In this guide, you’ll learn how to install Moltbot on a VPS step by step — from server setup to long-running background service configuration.
We’ll use LightNode VPS as the example environment because it’s:
- Hourly billing (perfect for testing and experiments)
- Fast deployment (server ready in minutes)
- NVMe SSD + stable network
- Global locations
- Full root access for customization
Why Deploy Moltbot on a VPS?
Running Moltbot on a VPS gives you:
- 24/7 uptime – no laptop shutdown issues
- Stable public IP – easier integrations and webhooks
- Remote management – access from anywhere
- Better performance – dedicated CPU/RAM resources
- Scalability – upgrade resources anytime
This turns Moltbot into a real long-term AI system, not just a local experiment.
Step 1: Create a VPS (LightNode Example)
- Go to LightNode:
👉 https://go.lightnode.com?ref=fa725d7f&id=58 - Choose a VPS location
- Select configuration (recommended minimum):
- CPU: 1 vCPU
- RAM: 2GB
- Storage: 20GB NVMe SSD
- Choose OS:
- Ubuntu 22.04 LTS (recommended)
- Create the server
- Copy your server IP, username, and password
Step 2: Connect to Your VPS
On Mac / Linux
ssh root@YOUR_SERVER_IPOn Windows (PowerShell)
ssh root@YOUR_SERVER_IPAfter login, update system:
apt update && apt upgrade -yStep 3: Install Required Dependencies
apt install -y git curl wget build-essential python3 python3-pip python3-venvVerify Python:
python3 --versionStep 4: Create Moltbot Environment
mkdir /opt/moltbot
cd /opt/moltbot
python3 -m venv venv
source venv/bin/activateStep 5: Install Moltbot
⚠️ Replace repository URL with the official Moltbot repo if different
git clone https://github.com/moltbot/moltbot.git .
pip install -r requirements.txtStep 6: Configure Moltbot
Create config file:
cp .env.example .env
nano .envExample configuration:
BOT_NAME=moltbot
API_KEY=your_api_key_here
MODEL_PROVIDER=openai
MODEL_NAME=gpt-4o-mini
PORT=8080
HOST=0.0.0.0Save with:
CTRL + X → Y → EnterStep 7: Test Moltbot Manually
python main.pyIf successful, you should see logs indicating Moltbot is running.
Stop test:
CTRL + CStep 8: Run Moltbot as a Background Service (systemd)
Create service file:
nano /etc/systemd/system/moltbot.servicePaste:
[Unit]
Description=Moltbot AI Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/moltbot
ExecStart=/opt/moltbot/venv/bin/python main.py
Restart=always
[Install]
WantedBy=multi-user.targetEnable and start:
systemctl daemon-reload
systemctl enable moltbot
systemctl start moltbotCheck status:
systemctl status moltbotStep 9: Open Firewall Port
ufw allow 8080
ufw reloadAccess Moltbot:
http://YOUR_SERVER_IP:8080Step 10: (Optional) Add Nginx + Domain + HTTPS
Install Nginx:
apt install -y nginxCreate config:
nano /etc/nginx/sites-available/moltbotserver {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}Enable:
ln -s /etc/nginx/sites-available/moltbot /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginxInstall SSL:
apt install -y certbot python3-certbot-nginx
certbot --nginx -d yourdomain.comNow Moltbot runs on HTTPS.
Architecture Overview
User → Domain → Nginx → Moltbot Service → AI Model API
↑
systemd daemonWhy LightNode VPS Works Well for Moltbot
LightNode is especially suitable for AI bots and agent systems because:
Hourly billing = low-risk testing
Global deployment = low-latency access
NVMe SSD = fast model/data IO
Stable IP = webhook + API friendly
VPS control = full customization
FAQ
What is Moltbot?
Moltbot is a self-hosted AI bot system that can run as a long-term service and integrate with different platforms and APIs.
Can I run Moltbot locally instead of a VPS?
Yes, but local setups are unstable for 24/7 operation. VPS is better for uptime, reliability, and remote access.
How much VPS resource does Moltbot need?
Minimum: 1 vCPU + 2GB RAM.
Recommended for production: 2 vCPU + 4GB RAM.
Is LightNode good for AI bots?
Yes. Hourly billing, fast provisioning, NVMe storage, and global nodes make it ideal for AI bot hosting.
How do I restart Moltbot if it crashes?
systemd auto-restarts it automatically:
systemctl restart moltbotCan I connect Moltbot to Telegram / Discord?
Yes. Moltbot can be integrated with messaging platforms via API/webhooks.