On this page
Building internal tools used to be a choice between two extremes: spending weeks writing a custom admin panel from scratch or paying a monthly per-user fee for a SaaS platform that locks your data in their cloud.
ToolJet changes this equation. It is an open-source, low-code framework that allows you to build internal dashboards by dragging and dropping components and connecting them to your databases or APIs. When you add AI capabilities into the mix, it becomes a powerhouse for automating business workflows.
The challenge? Most "AI" setups suggest high-end GPUs and expensive cloud instances. In this guide, I will show you how to deploy ToolJet AI on a budget-friendly $5/month VPS, integrate it with a local LLM (via Ollama), and keep your operational costs near zero.
Who Should Use This Setup?
This architecture is ideal for:
- Technical Founders: Who need a quick internal CRM or inventory manager without spending hours on frontend code.
- Sysadmins/Homelabbers: Who want to centralize their home or office automation with an AI-driven interface.
- Developers: Who want to prototype AI-powered tools without worrying about API costs from OpenAI or Anthropic.
- Privacy-Conscious Teams: Who cannot upload sensitive company data to third-party AI providers.
When NOT to Use This Setup?
Avoid this specific $5 VPS approach if:
- High Concurrency: You expect 50+ simultaneous users. A low-end VPS will choke under the load.
- Heavy LLM Workloads: If you need a 70B parameter model for complex reasoning, a $5 VPS (usually 1-2GB RAM) cannot host the model. You will need a dedicated GPU server or a separate LLM API endpoint.
- Mission-Critical Zero Downtime: If your business stops the moment the server is down, you need a clustered Kubernetes deployment, not a single Docker-Compose instance.
The Architecture: Budget vs. Performance
To run ToolJet on a $5 VPS, we have to be smart about resource allocation. ToolJet itself is relatively lightweight, but LLMs are not.
The secret is decoupling. We will host the ToolJet application on the cheap VPS and connect it to an LLM. If you have a spare PC at home, you can run Ollama there and tunnel it to the VPS. If you want everything on one box, you'll need to use the smallest quantized models (like Phi-3 or TinyLlama) or use a free-tier external API.
| Component | Budget Setup ($5 VPS) | Pro Setup (Dedicated) |
|---|---|---|
| CPU | 1-2 vCPUs | 8+ vCPUs |
| RAM | 1-2 GB | 32 GB+ |
| Storage | 20-40 GB SSD | NVMe RAID |
| LLM Execution | Remote/External or Tiny Model | Local GPU (RTX 3090/4090) |
| Database | Shared PostgreSQL Container | Managed DB Cluster |
Step-by-Step Deployment Guide
1. VPS Preparation
Choose a provider like Hetzner, DigitalOcean, or Linode. Select an Ubuntu 22.04 LTS image.
Once logged in via SSH, update the system and install Docker:
sudo apt update && sudo apt upgrade -y
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Install Docker Compose
sudo apt install docker-compose-plugin -y
2. Deploying ToolJet via Docker Compose
ToolJet provides a streamlined deployment path. We will use their official Docker Compose setup.
First, clone the repository or create a directory for your configuration:
mkdir tooljet-ai && cd tooljet-ai
# Download the environment file template
wget https://raw.githubusercontent.com/ToolJet/ToolJet/master/.env.example -O .env
Open the .env file and edit the following critical variables:
TOOLJET_HOST: Your VPS IP or domain (e.g.,http://ai.yourdomain.com)TOOLJET_PORT:3000SECRET_KEY: Generate a long random string.PG_PASSWORD: A strong password for your database.
Now, create your docker-compose.yml file:
version: '3'
services:
tooljet:
image: tooljet/tooljet:latest
restart: always
env_file: .env
ports:
- "3000:3000"
volumes:
- tooljet-data:/data
depends_on:
- postgres
postgres:
image: postgres:13
restart: always
environment:
POSTGRES_PASSWORD: ${PG_PASSWORD}
POSTGRES_USER: postgres
POSTGRES_DB: tooljet
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
tooljet-data:
postgres-data:
Run the deployment:
sudo docker compose up -d
3. Configuring TLS with Caddy (The Easy Way)
Running on port 3000 over HTTP is insecure. Caddy is the best choice for a $5 VPS because it handles SSL automatically and uses very little RAM.
Add Caddy to your docker-compose.yml:
caddy:
image: caddy:latest
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
# ... previous volumes
caddy_data:
caddy_config:
Create a file named Caddyfile in the same directory:
ai.yourdomain.com {
reverse_proxy tooljet:3000
}
Restart the containers: sudo docker compose up -d. Caddy will now automatically provision a Let's Encrypt certificate.
Integrating a Local LLM (Ollama)
To make ToolJet "AI-powered," you need a model. Running a large model on a $5 VPS will cause the system to crash (OOM - Out of Memory).
The Strategy: Run Ollama on your local machine (with a GPU) or a separate cheap home server, and expose it to your VPS.
Setup Ollama locally:
- Install Ollama from
ollama.ai. - Run a lightweight model:
ollama run llama3:8b(orphi3for even lower specs). - To make it accessible to your VPS, set the environment variable
OLLAMA_HOST=0.0.0.0and open port 11434 on your local firewall.
Connecting Ollama to ToolJet:
- Log into your ToolJet dashboard.
- Go to Data Sources $\rightarrow$ Add Source.
- Select REST API.
- Set the Base URL to your home IP/Domain:
http://your-home-ip:11434. - Now, in the ToolJet AI plugin or a custom query, you can send POST requests to
/api/generatewith the prompt.
Optimizing for Minimal Expense
If you are strictly sticking to a $5/month budget, follow these optimization tips:
- Swap File: 1GB of RAM is tight. Create a 2GB swap file to prevent Docker containers from crashing during updates.
Bash sudo fallocate -l 2G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo '/swapfile swap swap 0 0' | sudo tee -a /etc/fstab - Log Rotation: Docker logs can eat your SSD. Limit them in
docker-compose.yml:YAML logging: driver: "json-file" options: max-size: "10m" max-file: "3" - External LLM Free Tiers: If you don't have a local machine to run Ollama, use the Groq API or Together AI free tiers. They provide blazing-fast Llama 3 access via a standard OpenAI-compatible API, which ToolJet supports natively.
Pros and Cons of this Setup
Pros
- Data Sovereignty: Your business data stays on your hardware.
- Zero Licensing Fees: No "per-seat" pricing.
- Flexibility: You can swap LLMs (Llama $\rightarrow$ Mistral $\rightarrow$ Phi) without changing your frontend.
- Low Overhead: Caddy + Docker Compose is the leanest way to deploy.
Cons
- Hardware Limitation: No heavy lifting (complex AI tasks) on the $5 VPS itself.
- Maintenance: You are responsible for backups and security patches.
- Latency: If using a local LLM over the internet, you may experience slight delays.
FAQ
Q: Can I run Ollama on the same $5 VPS? A: Only if you use extremely small models (like TinyLlama) and have a swap file. Even then, response times will be very slow (seconds per token). It is highly recommended to run the LLM on a separate machine.
Q: How do I back up my ToolJet data?
A: The most important parts are the postgres-data and tooljet-data volumes. Use a tool like Restic or simply run docker exec to perform a pg_dump of the database daily.
Q: Is ToolJet AI secure?
A: By using Caddy for TLS and keeping your .env file restricted, it is secure. However, ensure you enable strong passwords and avoid exposing the Postgres port (5432) to the public internet.
Q: Which LLM is best for internal tools? A: For most internal tasks (summarization, data formatting), Llama 3 (8B) or Mistral (7B) are the sweet spots for performance and resource usage.
Q: Do I need a domain name?
A: For TLS/HTTPS, yes. You can get a cheap .xyz or .top domain, or use a free Dynamic DNS service if you are running this from home.
Final Thoughts
Self-hosting ToolJet AI transforms how you interact with your data. Instead of staring at a raw SQL table, you can build a natural language interface that allows you to "Ask your database" questions. By decoupling the application layer (VPS) from the intelligence layer (Local LLM/API), you get a professional-grade internal tool platform for the price of a fancy coffee per month.
If you found this guide helpful, check out more sysadmin and developer tutorials at mahbuburriad.com.