How to Host an AI Chatbot on a VPS 24/7 (2026)
Here is a scenario I see all the time. Someone builds a genuinely good AI chatbot — trained on their business docs, wired into their website — and then hosts it on their laptop. It works beautifully. Until they close the lid. Or the Wi-Fi drops. Or Windows decides 3 AM is the perfect time for an update. And just like that, the chatbot is down. Visitors get a dead widget. Leads go nowhere. The fix is simple: put the chatbot on a VPS that never sleeps. A small virtual server, running 24/7, serving your AI to the world while you do literally anything else. This guide shows you exactly how to host an AI chatbot on a VPS 24/7 — the model, the setup, the auto-restart plumbing, the web interface, and the security bits most tutorials skip. No fluff, just the working path. What “24/7” Actually Means (Be Honest With Yourself) Before we touch a terminal, let us define the target. “24/7” does not mean your chatbot literally never goes down — even Google has outages. It means three things: That is the bar. Everything in this guide exists to clear it. And the honest truth? Getting there takes about an hour, and most of that is waiting for downloads. What You Will Need Nothing exotic. Here is the full shopping list: That is it. No GPU needed — a quantized 7B or 8B model runs fine on CPU for chat workloads, answering at 10–30 tokens per second. Fast enough that visitors never notice. Step 1: Set Up Your VPS SSH into your fresh server. First, the boring-but-critical basics — updates, a firewall, and a non-root user. I know, I know, you want to get to the AI part. But an AI chatbot with an open port and a weak root password will be crypto-mining for a stranger by Thursday. Our VPS security guide goes deeper; here is the minimum: That gives you a patched server with only SSH, HTTP, and HTTPS reachable. If you have not done the rest of the new-server checklist (SSH keys, automatic updates), do it now — future-you will be grateful. Step 2: Install Ollama and Pull a Model Ollama is the easiest way to run open models on a server. One install command, one command per model, and you have an API serving completions. If you want the full background on how self-hosting models works, our complete guide to running AI models on a VPS covers it in depth. That downloads Meta’s Llama 3.1 8B — smart enough for customer support, FAQs, and document Q&A, small enough (~5 GB) to live comfortably in 8 GB of RAM. Want something else? ollama pull qwen2.5:7b is excellent for multilingual chat; mistral:7b is fast and sharp in English. Quick sanity check that it works: If it answers, your model is alive. Now let us make sure it stays alive. Step 3: Make It Survive Reboots (systemd) This is the step most tutorials skip — and it is the entire difference between “a chatbot” and “a chatbot that runs 24/7.” Ollama installs a systemd service by default on most setups, but let us verify and harden it, because silent failures here are how you get the 4 AM outage. enable is the magic word — it means “start this automatically on every boot.” Now add a safety net: if the process crashes, systemd should restart it instead of giving up. Create an override: Five lines, and your model now restarts itself within 5 seconds of any crash, and comes back after every reboot. That is 90% of “24/7” right there. Step 4: Give It a Web Interface (Open WebUI) Ollama alone is an API — great for developers, useless for visitors. Open WebUI is a polished ChatGPT-style interface that talks to Ollama. Your visitors get a familiar chat window; you get user accounts, chat history, and admin controls. Install Docker, then run it: Two details worth noticing. –restart unless-stopped means the web UI also comes back after reboots — same 24/7 principle, applied to every layer. And the data volume (-v open-webui:/app/backend/data) means user accounts and chat history survive container updates. I have seen people skip the volume, update the container, and lose everything. Do not be those people. Visit http://your-server-ip:3000 — you should see the Open WebUI signup page. Create your admin account (the first account becomes admin automatically). But do not stop here: right now it is HTTP on a raw IP. Let us fix that. Step 5: Put It Behind a Domain With Free HTTPS Nobody trusts a chatbot on http://203.0.113.42:3000. Point a DNS A-record for chat.yourdomain.com at your server’s IP, then install Caddy — a web server that gets free Let’s Encrypt certificates automatically, with roughly four lines of config: Then edit /etc/caddy/Caddyfile: That is genuinely all of it. Caddy fetches the certificate, renews it forever, and proxies visitors to Open WebUI over HTTPS. No certbot cron jobs, no manual renewals, no expiry panic. If you prefer Nginx, our Nginx on Ubuntu guide covers the manual route — but for a chatbot, Caddy’s simplicity wins. Step 6: Monitoring and Auto-Recovery You now have a chatbot that restarts itself and serves over HTTPS. The last piece of 24/7 is knowing — because “it restarted itself” is only comforting if you can verify it. 1. Free external uptime monitoring. Sign up for UptimeRobot’s free plan (50 monitors, plenty) and add https://chat.yourdomain.com. It pings every 5 minutes and emails you the moment the site stops responding. This is non-negotiable — it is the difference between finding out from a monitor in 5 minutes and finding out from an angry customer in 5 days. 2. Watch disk space. Chat logs and Docker images grow quietly. A full disk kills everything at once. Add a weekly check to your routine — or better, a one-line cron that warns you: 3. Keep an eye on memory. If your model plus Open WebUI plus the OS creep past physical
How to Host an AI Chatbot on a VPS 24/7 (2026) Read More »




