How to Self-Host NocoDB on a VPS (Complete Guide)
NocoDB is an open-source alternative to Airtable, allowing you to manage and create collaborative databases. Self-hosting NocoDB on a VPS gives you complete control and flexibility over your data. This guide walks you through the installation process using Docker on your server.
Why Use NocoDB?
NocoDB provides a user-friendly interface to create and manage databases. It supports API generation, table sharing, and powerful collaboration features. Developers prefer NocoDB for its open-source nature, extensive functionality, and the ability to self-host, which safeguards privacy and control over data.
Choosing a VPS Provider
Before installation, select an appropriate VPS provider. Hereโs a quick comparison of popular VPS options ideal for running NocoDB:
| Provider | Starting Price | Memory | Storage | Network |
|---|---|---|---|---|
| Contabo VPS | 5.99 EUR/mo | 4 GB | 200 GB | 50 Mbps |
| Hetzner Cloud | 4.15 EUR/mo | 2 GB | 20 GB | 1 Gbps |
| DigitalOcean | 6 USD/mo | 1 GB | 25 GB | 1 Gbps |
| Vultr | 6 USD/mo | 1 GB | 25 GB | 1 Gbps |
| Linode (Akamai) | 5 USD/mo | 1 GB | 25 GB | 1 Gbps |
Consider your needs: if you expect high traffic or require more resources for NocoDB, Contabo or Hetzner might be better suited.
For a comprehensive list of providers, check our full VPS comparison.
Setting Up Your VPS
1. Create a VPS Instance
Select a preferred VPS provider and create an instance. Use Ubuntu 20.04 as the base operating system for optimal compatibility. Log in via SSH to your new VPS.
ssh root@your_vps_ip
2. Install Docker
NocoDB runs smoothly in a Docker container. To install Docker, update your package index and install the required packages:
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
Next, add the Docker official GPG key and repository:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Install Docker Engine:
sudo apt update
sudo apt install -y docker-ce
3. Run NocoDB in Docker
After Docker installation, pull the NocoDB image:
sudo docker pull nocodb/nocodb
Next, run the NocoDB container with the following command:
sudo docker run -d --name nocodb -p 8080:8080 nocodb/nocodb
This command starts NocoDB and maps it to port 8080 of your VPS. Ensure that your firewall allows traffic through this port.
4. Access NocoDB
You can now access NocoDB through your browser at http://your_vps_ip:8080. Initial setup will guide you through configuring your workspace and databases.
Configuring NocoDB
Once youโve accessed NocoDB, configure your database connections. NocoDB supports various database backends, including MySQL, PostgreSQL, and SQLite. For example, if youโre using MySQL, provide the connection details in the NocoDB interface.
Secure Your NocoDB Instance
Itโs critical to secure your NocoDB installation:
- Use HTTPS: Consider running a reverse proxy like Nginx with Letโs Encrypt for SSL certificates.
- Environment Variables: Use
.envfiles to maintain sensitive credentials for databases. - Regular Backups: Schedule regular database backups to avoid data loss.
Common Issues and Troubleshooting
1. Unable to Connect to NocoDB
If you cannot access NocoDB, check that the Docker container is running:
sudo docker ps
If NocoDB isnโt listed, restart the container or check Docker logs for errors:
sudo docker logs nocodb
2. Resource Constraints
If you experience performance issues, consider upgrading your VPS plan. Both Contabo and Hetzner offer scalable options to meet increased demand.
3. Database Connection Errors
Ensure that your database service is accessible and that credentials are correctly specified in NocoDB. Check your database firewall settings if youโre using a managed database service.
FAQs
Can I run NocoDB on a low-spec VPS?
Yes, NocoDB has relatively low system requirements and can run on a VPS with 1 GB of RAM. However, for multiple concurrent users and heavier usage, consider a VPS with at least 2 GB of RAM, like Hetzner Cloud or Contabo, to ensure smooth performance.
Is it difficult to migrate from a self-hosted NocoDB to a managed solution?
Migrating from a self-hosted instance of NocoDB to a managed solution is manageable. Back up your data and configurations, then restore them on the new instance. Just ensure both environments are compatible, and follow the providerโs migration guidelines.
How do I update NocoDB?
To update NocoDB running in Docker, first stop the container:
sudo docker stop nocodb
Then pull the latest image and restart the container:
sudo docker pull nocodb/nocodb
sudo docker run -d --name nocodb -p 8080:8080 nocodb/nocodb
This process downloads the new version and runs it. Regular updates ensure you benefit from the latest features and security fixes.