How to Run an AI Agent on a VPS: Beginner-to-Advanced Setup Checklist
How to Run an AI Agent on a VPS: Beginner-to-Advanced Setup Checklist
Running an AI agent on a VPS is one of the best ways to learn real AI infrastructure. A VPS can host the agent dashboard, connect to model APIs, receive webhooks, run background tasks and keep logs.
This guide is not about making a flashy demo. It is about setting up an agent in a way that can be tested, secured and improved.
What you need before starting
- A VPS provider such as Hostinger, DigitalOcean, Hetzner or another cloud host.
- A domain or subdomain if you want a clean URL.
- SSH access or a hosting dashboard.
- An AI model provider API key.
- A plan for logs, backups and spending limits.
Step 1: choose the VPS
Start small. For an API-based agent, you usually do not need a GPU. The VPS mainly runs the app, stores settings, handles webhooks and talks to an external AI API.
Choose a plan with enough RAM for your app and database. If you are only testing, do not start with the biggest plan.
Step 2: connect a domain or subdomain
Use a subdomain such as agent.yoursite.com. In your DNS settings, point the subdomain to the VPS IP address. Wait for DNS propagation, then test the URL.
Step 3: add HTTPS
Never use an agent dashboard with private keys over plain HTTP. Add SSL/HTTPS before connecting real providers or channels. Most hosting providers have built-in SSL instructions or a reverse proxy path.
Step 4: install the agent framework
You can use OpenClaw, another agent framework, or your own app. For beginners, OpenClaw is attractive because Hostinger has OpenClaw-related support and setup material.
If you are installing manually, document every command and save your configuration. If you use a 1-click path, still learn where logs, backups and settings live.
Step 5: connect one model provider
Do not connect every model provider at once. Add one key first, test one model, send a few prompts and check output quality, latency and cost.
- Use separate API keys per project.
- Set usage limits or billing alerts.
- Do not paste keys into public code or screenshots.
Step 6: connect one channel
Start with one private test channel. Telegram is often easier for testing than public WhatsApp or customer-facing channels. Send basic prompts, confusing prompts and unsafe requests to see how the agent behaves.
Step 7: add logs
At minimum, log:
- timestamp,
- user/channel,
- model used,
- request type,
- tool calls,
- error result,
- human approval status.
Logs are what separate a serious agent from a toy demo.
Step 8: add backups and rollback
Before giving the agent more power, create a backup plan. Know how to restore the VPS, database and configuration. Also know how to disable the agent quickly if it behaves badly.
Step 9: launch with one workflow
Do not automate everything. Launch one narrow workflow such as:
- summarizing incoming messages,
- drafting support replies,
- organizing notes,
- watching GitHub notifications,
- creating internal task summaries.
Step 10: monitor cost and behavior
Check model usage, server CPU/RAM, storage, errors and response quality. If cost grows, reduce prompt length, cache repeated context or use a smaller model for simple tasks.
GPUJet safety rule
An AI agent on a VPS should start with limited access, low spending limits, private testing and human approval. Add more autonomy only after logs prove the workflow is stable.
Related GPUJet guides: AI Agent Safety Checklist, AI API Cost Control Tutorial, OpenClaw Telegram and WhatsApp Tutorial.
