$ ssh root@YOUR_VPS_IP$ adduser dev$ usermod -aG sudo dev$ apt update$ apt install -y git tmux curl$ su - dev
Codex CLI is not installed automatically and needs a paid account: a ChatGPT plan that includes Codex, or an OpenAI API key billed by usage. No OpenAI account comes with the VPS, and the models run at OpenAI.
Choose the resources of your VPS
Codex CLI runs on all our Linux VPS plans: you only pay for the VPS.
With your consent, we measure which ads bring us customers and how the site is used. Without it, nothing is measured and the site works exactly the same. You can change your mind at any time. Cookie policy.
Install Codex CLI on a VPS and run OpenAI's agent over SSH
Install Codex CLI on an Ubuntu 24.04 VPS and let OpenAI's coding agent work over SSH. Requires a paid ChatGPT plan or an OpenAI API key.
Codex CLI is OpenAI's open source coding agent for the terminal. On a VPS it works on your repositories without tying up your computer.
Step-by-step procedure
Order the VPS and add a user
Order a VPS Mini running Ubuntu 24.04 LTS, connect as root with your SSH key, then create a dedicated user for the agent.
Install git and tmux
Install the basic tools from the Ubuntu repositories, then switch to the dev user for the next steps.
Install Codex CLI
Run the official install script listed in the Codex README. Another documented method: npm install -g @openai/codex if Node.js is installed.
Sign in without a browser
On a server, use device code sign-in, which you first enable in your ChatGPT security settings, or an OpenAI API key passed through standard input.
Start Codex in a repository
Open a tmux session, go into your project and run codex. Detach with Ctrl+B then D, and come back later with tmux attach -t codex.
Choose the resources of your VPS
Codex CLI runs on all our Linux VPS plans: you only pay for the VPS.
Recommended base: Ubuntu 24.04
VPS Mini: €3.99 per month incl. VAT with a 1-year term (or €4.99 per month with no commitment) · 2 vCPU · 8 GB RAM · 40 GB storage
VPS Essentiel: €7.99 per month incl. VAT with a 1-year term (or €9.99 per month with no commitment) · 4 vCPU · 16 GB RAM · 80 GB storage
VPS Performance: €17.59 per month incl. VAT with a 1-year term (or €21.99 per month with no commitment) · 8 vCPU · 48 GB RAM · 150 GB storage
VPS Pro: €27.99 per month incl. VAT with a 1-year term (or €34.99 per month with no commitment) · 12 vCPU · 64 GB RAM · 250 GB storage
Why run Codex CLI on a VPS?
Codex CLI is a coding agent from OpenAI that runs in the terminal: it reads your project, proposes and applies changes, and runs commands and tests. The client is open source, under the Apache 2.0 license, and available for Linux and macOS. The reasoning is done by OpenAI models in the cloud: only the tool runs on the machine.
On a VPS, Codex gets a dedicated machine that is always on. Long tasks keep running in tmux after you disconnect, and the agent works in an environment separate from your computer that you can back up or reinstall. You need a paid ChatGPT plan that includes Codex, or an OpenAI API key billed by usage.
Long tasks inside tmux
Run Codex in a tmux session: it keeps going on the server when you close SSH, and you pick it up from any machine.
Isolated from your computer
The agent runs commands on the VPS, not on your computer. If something goes wrong, restore a backup or reinstall Ubuntu from the panel.
Root for your toolchains
Install the languages, package managers and test databases of your projects: Codex uses them to build and run tests.
Reserved resources for your builds
The 2 vCPU and 8 GB of RAM of the VPS Mini are reserved for your machine: builds and tests take nothing from your computer.
Before you start
Good to know: Codex CLI is not installed automatically and needs a paid account: a ChatGPT plan that includes Codex, or an OpenAI API key billed by usage. No OpenAI account comes with the VPS, and the models run at OpenAI.
Ubuntu 24.04 LTS (Codex ships Linux x86_64 and arm64 binaries)
VPS Mini (2 vCPU, 8 GB RAM): the tool is light, your builds decide
A paid ChatGPT plan that includes Codex (Plus, Pro, Business, Edu, Enterprise) or an OpenAI API key
Outbound internet access to OpenAI services
Git, tmux and your repositories
Install Codex CLI on your VPS
The main steps, to follow over SSH. The official documentation is the reference for the details.
Order the VPS and add a user: Order a VPS Mini running Ubuntu 24.04 LTS, connect as root with your SSH key, then create a dedicated user for the agent.
Install git and tmux: Install the basic tools from the Ubuntu repositories, then switch to the dev user for the next steps.
Install Codex CLI: Run the official install script listed in the Codex README. Another documented method: npm install -g @openai/codex if Node.js is installed.
Sign in without a browser: On a server, use device code sign-in, which you first enable in your ChatGPT security settings, or an OpenAI API key passed through standard input.
Start Codex in a repository: Open a tmux session, go into your project and run codex. Detach with Ctrl+B then D, and come back later with tmux attach -t codex.
For which projects?
Coding agent in the cloud
Fix a failing CI
Write tests in bulk
Code from another machine
The essentials, included in every plan
No hidden extras for the essentials: protection, an IP address, a recovery console and support from real people are included from the first plan.
Anti-DDoS: Network protection is included on every service, with no paid option.
Dedicated IPv4: Each VPS has its own public address and full root access.
Recovery console: Take back control of your VPS with the noVNC console, even without SSH.
Support 7 days a week: By ticket and on Discord, from a team that knows your services.
No commitment: Monthly, cancellable at any time, or yearly to pay less.
Run Codex CLI on your own VPS.
Choose your resources, install, stay in control. No commitment.
Frequently asked questions
How do I install Codex CLI on a VPS?
On an Ubuntu 24.04 VPS, create a non-root user, install git and tmux, then run the official script curl -fsSL https://chatgpt.com/codex/install.sh | sh, or npm install -g @openai/codex if Node.js is present. Then sign in with codex login --device-auth or an API key, and start codex in a repository.
Is Codex CLI free?
The client is open source, but using it is not free: you sign in with a ChatGPT account whose plan includes Codex (OpenAI lists Plus, Pro, Business, Edu and Enterprise) or with an OpenAI API key billed by consumption. The VPS does not include any OpenAI subscription: you manage it with them directly.
Which VPS plan for Codex CLI?
OpenAI does not publish a RAM requirement, and the models run in the cloud: the VPS runs the tool, Git and your tests. The VPS Mini (2 vCPU, 8 GB RAM) suits most projects. If your builds or test suites are heavy, or several agents work at the same time, pick the VPS Essential.
How do I sign in to Codex on a server without a browser?
First enable device code sign-in in your ChatGPT account security settings, then run codex login --device-auth, open the link on your own computer and enter the code. The documentation also offers an API key through codex login --with-api-key, or an SSH tunnel to port 1455 for the regular sign-in.
Where does Codex store its credentials?
Codex saves its credentials in ~/.codex/auth.json, in the home folder of the user who signed in. That file gives access to your account: never commit it to a repository, keep the server to people you trust and delete it before cancelling the VPS. The documentation also lets you copy this file from a machine that is already signed in.