CapRover is a powerful, self-hosted Platform-as-a-Service (PaaS) that makes deploying applications incredibly simple. Combined with RamNode’s reliable and affordable VPS hosting, you get a robust deployment solution that rivals expensive cloud platforms. In this guide, we’ll walk through the entire process of setting up CapRover on a RamNode VPS and deploying your first application.
Why Choose CapRover + RamNode?
CapRover Benefits:
- One-click app deployments
- Automatic SSL certificates via Let’s Encrypt
- Built-in load balancer and reverse proxy
- Docker-based containerization
- Easy database management
- Zero-downtime deployments
RamNode Advantages:
- Competitive pricing with excellent performance
- Multiple data center locations
- SSD and NVMe storage and high-speed networking
- Reliable uptime and support
- Flexible configurations
Prerequisites
Before we begin, ensure you have:
- A RamNode VPS with at least 1GB RAM (2GB+ recommended)
- Ubuntu 22.04 or 24.04 LTS installed
- A domain name pointing to your VPS IP
- SSH access to your server
- Basic command line knowledge
Setting Up Your RamNode VPS
Initial Server Configuration
First, connect to your RamNode VPS via SSH:
ssh root@your-server-ip
Update your system packages:
apt update && apt upgrade -y
Create a Non-Root User (Optional but Recommended)
adduser caprover
usermod -aG sudo caprover
su - caprover
Configure Firewall
Install and configure UFW (Uncomplicated Firewall):
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 3000/tcp
sudo ufw enable
Installing Docker
CapRover requires Docker to function. Install Docker using the official installation script:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Add your user to the docker group:
sudo usermod -aG docker $USER
Log out and back in for the changes to take effect, then verify Docker is working:
docker --version
docker run hello-world
Installing CapRover
Install CapRover Server
Run the CapRover installation command:
docker run -p 80:80 -p 443:443 -p 3000:3000 -d \
--name captain-captain \
--restart=unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /captain:/captain \
caprover/caprover
Initial Setup
Wait for the container to start (about 30 seconds), then access CapRover at:
http://your-domain.com:3000
The default password is captain42
. You’ll be prompted to change this immediately.
Configure Root Domain
During the initial setup, you’ll need to:
- Set your root domain (e.g.,
yourdomain.com
) - Configure your email for Let’s Encrypt SSL certificates
- Change the default password
Installing CapRover CLI
On your local machine, install the CapRover CLI tool:
npm install -g caprover
If you don’t have Node.js installed, you can download it from nodejs.org.
Connecting to Your CapRover Instance
From your local machine, connect to your CapRover server:
caprover serversetup
Enter the following information when prompted:
- Setup a new CapRover server: Yes
- IP address of server: Your RamNode VPS IP
- CapRover server URL:
https://captain.yourdomain.com
- New CapRover name: Choose a memorable name
- CapRover server password: The password you set earlier
Deploying Your First Application
Prepare Your Application
For this example, we’ll deploy a simple Node.js application. Create a package.json
file:
{
"name": "my-caprover-app",
"version": "1.0.0",
"description": "Sample CapRover application",
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "^4.18.0"
}
}
Create an app.js
file:
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
app.get('/', (req, res) => {
res.send('Hello from CapRover on RamNode!');
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
Create a captain-definition
file (this tells CapRover how to build your app):
{
"schemaVersion": 2,
"dockerfilePath": "./Dockerfile"
}
Create a Dockerfile
:
FROM node:16-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
Deploy the Application
Initialize your app for CapRover:
caprover deploy
Follow the prompts:
- Select your CapRover server
- Enter your app name (e.g.,
my-first-app
) - Choose whether to create the app if it doesn’t exist
Your application will be built and deployed automatically!
Configuring Your Application
Access the CapRover Dashboard
Visit https://captain.yourdomain.com
and log in to access the web interface.
Configure App Settings
In the dashboard, you can:
- Set environment variables
- Configure custom domains
- Enable SSL certificates
- Set up persistent storage
- View logs and metrics
Set Up Custom Domain
- Go to Apps → Your App Name
- Click on “HTTP Settings”
- Add your custom domain
- Enable HTTPS with Let’s Encrypt
- Force HTTPS redirection
Advanced Configuration
Setting Up Databases
CapRover includes one-click apps for popular databases:
- Go to “One-Click Apps/Databases”
- Select your database (MySQL, PostgreSQL, MongoDB, etc.)
- Configure and deploy
- Connect your application using the provided connection details
Environment Variables
Set environment variables in your app’s settings:
NODE_ENV=production
DATABASE_URL=your-database-connection-string
API_KEY=your-secret-key
Persistent Storage
For applications that need to store files:
- Go to your app’s settings
- Click “App Configs”
- Add persistent directories under “Persistent Directories”
Monitoring and Maintenance
Viewing Logs
Monitor your application through the CapRover dashboard:
- Real-time logs
- Application metrics
- Resource usage
Backup Strategy
Set up regular backups:
- Database dumps
- Application data
- CapRover configuration
Updates
Keep your system updated:
# Update CapRover
docker service update captain-captain --image caprover/caprover:latest
# Update system packages
sudo apt update && sudo apt upgrade -y
Troubleshooting Common Issues
Issue: Can’t Connect to CapRover Dashboard
Solution:
- Check if the container is running:
docker ps
- Verify firewall settings allow port 3000
- Ensure DNS is properly configured
Issue: Deployment Fails
Solution:
- Check build logs in the CapRover dashboard
- Verify Dockerfile syntax
- Ensure all required files are included
Issue: SSL Certificate Problems
Solution:
- Verify domain DNS points to your server
- Check Let’s Encrypt rate limits
- Try manual certificate renewal in dashboard
Security Best Practices
- Change Default Passwords: Always change default credentials
- Use SSH Keys: Disable password authentication for SSH
- Regular Updates: Keep system and Docker images updated
- Firewall Configuration: Only open necessary ports
- SSL Everywhere: Use HTTPS for all applications
- Backup Regularly: Implement automated backup strategies
Cost Optimization Tips for RamNode
- Right-size Your VPS: Start small and scale as needed
- Monitor Resource Usage: Use CapRover’s built-in monitoring
- Optimize Images: Use Alpine-based Docker images when possible
- Clean Up Unused Resources: Regularly remove old containers and images
Conclusion
Deploying applications with CapRover on a RamNode VPS provides an excellent balance of simplicity, performance, and cost-effectiveness. This setup gives you the power of enterprise-grade deployment tools without the complexity or expense of major cloud platforms.
With CapRover handling the deployment automation and RamNode providing reliable infrastructure, you can focus on what matters most: building great applications. The combination offers automatic SSL certificates, zero-downtime deployments, easy scaling, and comprehensive monitoring—all from an intuitive web interface.
Whether you’re deploying a simple web application or a complex microservices architecture, this setup will serve you well. Start with a basic RamNode VPS, grow your applications, and scale your infrastructure as your needs evolve.