How to Deploy an AI-Built App to a VPS Securely
A step-by-step guide to hosting an AI-built app on a Hostinger KVM2 VPS with Docker, Codex CLI and Hostinger's agent, plus HTTPS, a login and basic security.
For Engineering, IT and Security

How do you host an app you built with AI on a VPS?
Rent a small virtual private server (VPS), pick an operating system image that already includes Docker, and let an AI agent copy your app onto it and configure it. A VPS is a computer in a data center that you rent and control. Docker packages your app and everything it needs into one unit that runs the same anywhere. Then you add HTTPS, a login and a firewall so the app isn't open to the whole internet.
This walkthrough follows one creator's demonstration with a Hostinger KVM2 server, Codex CLI and Hostinger's built-in agent. The segment was sponsored by Hostinger. The same approach works on other providers, but the menu names below are Hostinger's.
TL;DR
- A VPS gives your app an address you can reach from anywhere, and lets long jobs keep running after you close your laptop.
- The demonstrated setup was a Hostinger KVM2 plan (2 vCPU cores, 8 GB RAM, 100 GB NVMe disk) with a Docker template as the operating system.
- You can have Codex CLI connect to your Hostinger account, or use the AI agent inside Hostinger's web terminal, which suits people who don't like the command line.
- Never paste a password into an AI chat. Have the agent give you a command that you run yourself and that asks for the password privately.
- Put the app behind HTTPS and a login, and restrict access further with an IP allowlist if you only use it from one place.
- Basic hygiene still matters: a password manager, prompt updates and two-factor authentication.
Why put an AI-built app on a VPS at all?
An app that runs only on your laptop has limits. You can't open it from another city, and a long job stops when the lid closes. A VPS fixes both.
The creator's example was a personal video editor he built to replace a paid subscription. It transcribes audio with Whisper (a free, open-source speech-to-text model), cuts retakes and silences, and edits through a text interface. Moving it to a VPS meant he could open it while traveling, keep all his videos in one backed-up place, and leave jobs running without his desktop machine.
The same logic applies to any small internal tool: a tracker, a report generator, a client portal. If you built it with AI and want it reachable by you or your team, it needs a home.
Which VPS plan and settings should you choose?
In the demonstration, the pick was the KVM2 plan. It has two vCPU cores, 8 GB of RAM and 100 GB of NVMe disk space. The creator's view was that unless you know you need more, it is a sensible starting point, and enough for a modest app or a few agents. Treat that as one person's recommendation, not a sizing rule. A heavy workload may need more.
The choices, in order:
- Plan and term. Select KVM2 and a billing length. Longer terms usually cost less per month.
- Server location. Pick the region closest to you and your users. He chose the United States for the best latency (the delay between click and response).
- Operating system. Go to the Applications tab and choose Docker with Traefik. Traefik is a tool that routes incoming web traffic to the right container.
- Access. If you know SSH keys, use them. If not, create a strong root password. This is the main admin password for the server, so generate a long one and store it in a password manager.
- Optional extras. Hostinger offers some free add-ons during setup. Read them and keep only what you need.
After that, the server builds in a few seconds to a few minutes. The creator also suggested rebooting and updating the system before deploying anything.
What is Docker, and why does it matter here?
Docker bundles your app, its libraries and its settings into one package, called an image. That image behaves the same on your machine, on the server or on a colleague's computer. This removes the classic "it works on my laptop" problem.
For you, the practical benefit is that an AI agent can build or run that package on the server without guessing what is installed. If something breaks, you can stop the container and start again without damaging the rest of the server.
How do you connect Codex CLI to Hostinger?
Codex CLI is OpenAI's coding agent that runs in a command line interface (CLI), the text window called Terminal on Mac and Linux or PowerShell on Windows. OpenAI publishes install instructions for each system. Other labs have similar tools, including Claude, Google's Antigravity and Grok Build.
You don't need to memorize commands. Start Codex and ask it:
I already have a Hostinger VPS. How do I connect Codex to my Hostinger account?
It gives you a command, and often runs it for you. A browser window opens, you log in to Hostinger, and you confirm that you want to connect Codex to your VPS. Tell Codex it's done and ask it to test the connection. In the demonstration, it found both of the creator's KVM2 servers and could see that they were running.
Once connected, Codex can inspect what's running, diagnose problems, deploy apps and check for security issues. It can also run periodic checks and notify you if something looks wrong.
One benefit he pointed out: because the same agent that built your app handles the deployment, it already has the context. It also took security steps unprompted. In his case, some files contained API keys, and it stripped them out before uploading so they weren't exposed on the server. Keys still have to reach the server somehow, so ask the agent how it handles them.
How do you deploy with Hostinger's built-in agent?
If you'd rather not use a local command line at all, use the web terminal.
- In Hostinger, click Manage VPS.
- Click the Web console button next to your server.
- Click the Agent button in the bottom right of the terminal and choose to try it.
Give it context first. Something like:
I'm trying to deploy an app on my VPS. The files are in a zip file at [location]. It's a Python app. Please install and deploy it.
The agent asks what kind of app it is and how the files will be transferred. In the demonstration, Codex had already uploaded the app as a zip, so the agent only needed the location. It then installed and deployed everything. If errors appear, ask it to inspect the logs and troubleshoot. If the app needs secrets such as an API key, the agent tells you which ones are missing.
How do you add HTTPS and a login?
An app that's simply "out there" can be used by anyone who finds the address. The agent flagged this itself and offered two protections:
- A username and password. Good when you want access from anywhere.
- An IP allowlist. Only connections from addresses you name are accepted. Good if you always work from the same office or home.
HTTPS encrypts the connection between your browser and the server so passwords and files aren't readable in transit. Ask for it in plain words:
Put the app on HTTPS, make it start automatically after a server restart, and add a login prompt with the username [name]. Give me a command to run in the VPS terminal that asks for the password, so the password doesn't go through this chat.
That last instruction matters. The agent gives you a command, you paste it into the terminal and type the password there. The password is saved on the server and never passes through the AI. When you tell the agent you're done, it finishes the setup. Opening the app's address then shows a login prompt, and the app loads only after you sign in.
What else should you lock down?
The video's detail on the firewall, DDoS protection and snapshots was not fully available in the source, so here is the general version. Check your own provider's panel for each.
| Protection | What it does | What to do |
|---|---|---|
| Firewall | Blocks all network ports except the ones you need, usually web traffic and your admin access | Allow only what the app uses. Ask the agent to list open ports. |
| DDoS protection | Reduces damage from floods of junk traffic | See whether your plan includes it and turn it on if offered. |
| Snapshots and backups | Save a restorable copy of the whole server | Take one after a working deploy and before big changes. |
| Updates | Fix known security holes | Install them promptly, as the creator advised. |
| Passwords and 2FA | Stop stolen or guessed logins | Use a password manager and two-factor authentication (an authenticator app or text code). |
What this means for you
If you're a marketer, analyst or manager who built a small tool with AI, you no longer need an IT ticket to share it. A KVM2-class server, Docker and an agent that walks you through setup is within reach of a non-engineer. The cost of that convenience is responsibility. You own the server, so you own the updates, the backups and the access list.
Do these three things first: ask the agent to confirm that no secrets were uploaded in plain files, set a login before sharing the address, and take a snapshot once everything works. If the app holds customer or company data, tell your security team before it goes live.
Is there a way to skip the server work entirely?
If managing a VPS sounds like more than you want, Remy is built for that situation. You describe the tool you need in plain English, such as a request form, a tracker or a small dashboard, and Remy builds the full-stack app and deploys it to a live URL. The database, sign-in, hosting and backups come built in, so there is no server to configure. The code is standard TypeScript in a git repo you own. Pricing starts at $99 per month ($79 billed annually), with AI tokens billed at cost, and there is a 7-day free trial.
Frequently Asked Questions
Do I need to know how to code to deploy to a VPS?
Not necessarily. An agent like Codex or Hostinger's web-terminal agent can run the commands and explain them. You still need to read what it proposes, especially around passwords, open ports and where your API keys go.
Is it safe to give an AI agent access to my server?
It carries real risk, so limit it. Connect only the server you intend to use, never paste passwords into the chat, and review what it plans to change. Use the command-based password method so credentials go straight to the server.
Should I use a password or an IP allowlist?
Use a username and password if you need access from different places. Use an IP allowlist if you always connect from the same address, since it blocks everyone else. You can combine both, but remember that a home IP address can change.
What happens if the server restarts?
Ask the agent to configure the app to start automatically after a restart, as in the demonstration. Otherwise the app stays offline until someone starts it by hand.
How we source, write, and correct our articles. Editorial standards
Related articles

What Was the Hugging Face Incident? Christiano on Reward Hacking

How to Run Private Offline RAG and Coding Agents Locally

Microsoft Copilot Harness in Foundry Agent Service Explained
