Codex CLI is a powerful command-line assistant made for developers who love building directly in the terminal. Instead of just generating suggestions, it actively interacts with your codebase — reading files, proposing improvements, and even executing changes inside a safe, sandboxed environment.
Whether you’re writing unit tests, renaming files, updating documentation, or building an entire feature — Codex handles it all with a simple prompt. You give the instruction, it handles the heavy lifting, and everything stays version-controlled.
With full support for Node.js, Git, and common shell environments, Codex CLI blends real-time code reasoning with the tools you already use — making it perfect for solo hacking, team workflows, and automation.
This is code automation with control. Use it interactively or run it quietly in CI pipelines. Choose between approval modes for safe edits or full auto mode for hands-free execution — all while keeping your local files protected and your network access secure.
No complicated setup. Just install it, plug in your API key, and start building smarter — directly from your terminal.
System Requirements
Ensure your VM meets the following specifications:
- Operating System: Ubuntu 20.04+, Debian 10+, or Windows 11 via WSL2
- Node.js: Version 22 or newer (LTS recommended)
- Git: Version 2.23+ (optional but recommended for version control features)
- RAM: Minimum 4 GB (8 GB recommended for better performance)
In this guide, we’ll run Codex CLI on a GPU-based Virtual Machine for general-purpose development. However, you don’t need a GPU — Codex CLI runs perfectly fine on a CPU-only setup as well.
These requirements are sufficient for running Codex CLI on a lightweight VM environment — no dedicated GPU is required.
Step-by-Step Process to Install OpenAI Codex CLI Locally
For the purpose of this tutorial, we will use a GPU-powered Virtual Machine offered by NodeShift; however, you can replicate the same steps with any other cloud provider of your choice. NodeShift provides the most affordable Virtual Machines at a scale that meets GDPR, SOC2, and ISO27001 requirements.
Step 1: Sign Up and Set Up a NodeShift Cloud Account
Visit the NodeShift Platform and create an account. Once you’ve signed up, log into your account.
Follow the account setup process and provide the necessary details and information.
Step 2: Create a GPU Node (Virtual Machine)
GPU Nodes are NodeShift’s GPU Virtual Machines, on-demand resources equipped with diverse GPUs ranging from H100s to A100s. These GPU-powered VMs provide enhanced environmental control, allowing configuration adjustments for GPUs, CPUs, RAM, and Storage based on specific requirements.
Navigate to the menu on the left side. Select the GPU Nodes option, create a GPU Node in the Dashboard, click the Create GPU Node button, and create your first Virtual Machine deploy
Step 3: Select a Model, Region, and Storage
In the “GPU Nodes” tab, select a GPU Model and Storage according to your needs and the geographical region where you want to launch your model.
We will use 1 x RTXA6000 GPU for this tutorial to achieve the fastest performance. However, you can choose a more affordable GPU with less VRAM if that better suits your requirements.
Step 4: Select Authentication Method
There are two authentication methods available: Password and SSH Key. SSH keys are a more secure option. To create them, please refer to our official documentation.
Step 5: Choose an Image
Next, you will need to choose an image for your Virtual Machine. We will deploy OpenAI Codex CLI on an NVIDIA Cuda Virtual Machine. This proprietary, closed-source parallel computing platform will allow you to install OpenAI Codex CLI on your GPU Node.
After choosing the image, click the ‘Create’ button, and your Virtual Machine will be deployed.
Step 6: Virtual Machine Successfully Deployed
You will get visual confirmation that your node is up and running.
Step 7: Connect to GPUs using SSH
NodeShift GPUs can be connected to and controlled through a terminal using the SSH key provided during GPU creation.
Once your GPU Node deployment is successfully created and has reached the ‘RUNNING’ status, you can navigate to the page of your GPU Deployment Instance. Then, click the ‘Connect’ button in the top right corner.
Now open your terminal and paste the proxy SSH IP or direct SSH IP.
Step 8: Update Your System
Run the following command to update your system:
sudo apt update && sudo apt upgrade -y
Step 9: Install Node.js v22 (LTS)
Run the following command to install Node.js:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
Run the following command to verify the version of Node.js:
node -v
npm -v
Step 10: Install Git
Run the following command to install the git:
sudo apt install -y git
git --version
Step 11: Install pnpm
Run the following command to install the pnpm:
curl -fsSL https://get.pnpm.io/install.sh | sh -
Next, run the following command to reload the shell:
source ~/.bashrc # or ~/.zshrc
Then, run the following command to verify the version of pnpm:
pnpm -v
Step 12: Install Codex CLI Globally
Run the following command to install codex cli globally:
pnpm add -g @openai/codex
Step 13: Set Your OpenAI API Key
Run the following command to setup your openai api key:
export OPENAI_API_KEY="your-openai-api-key"
Step 14: Run Codex CLI
codex "prompt"
Conclusion
Codex CLI brings the power of interactive development directly into your terminal — making it easier than ever to build, refactor, document, and automate your workflow without ever leaving your shell. Whether you’re using a GPU-powered VM on NodeShift or a simple CPU setup, getting started is quick and hassle-free. With just a few commands, you’re ready to supercharge your development environment with Codex — no heavy lifting required.
Now go build something awesome — straight from your terminal.