{"id":3525,"date":"2026-05-18T03:18:35","date_gmt":"2026-05-18T03:18:35","guid":{"rendered":"https:\/\/aiopsschool.com\/blog\/?p=3525"},"modified":"2026-05-18T03:18:38","modified_gmt":"2026-05-18T03:18:38","slug":"codex-how-to-install-codex-in-linux","status":"publish","type":"post","link":"https:\/\/aiopsschool.com\/blog\/codex-how-to-install-codex-in-linux\/","title":{"rendered":"Codex: How to install Codex in Linux?"},"content":{"rendered":"\n<p>To install <strong>OpenAI Codex CLI on Linux<\/strong>, use the <strong>npm method<\/strong>. The official Codex docs say the CLI supports <strong>Linux<\/strong>, can be installed with npm, and starts with the <code>codex<\/code> command. The first run prompts you to sign in with your ChatGPT account or an API key. (<a href=\"https:\/\/developers.openai.com\/codex\/cli\">OpenAI Developers<\/a>)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Install Node.js and npm<\/h3>\n\n\n\n<p>For Ubuntu\/Debian:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install -y nodejs npm git\n<\/code><\/pre>\n\n\n\n<p>Check:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>node -v\nnpm -v\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. Install Codex CLI<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo npm i -g @openai\/codex\n<\/code><\/pre>\n\n\n\n<p>Official install command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm i -g @openai\/codex\n<\/code><\/pre>\n\n\n\n<p>I used <code>sudo<\/code> above because many Linux systems require admin permission for global npm installs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Run Codex<\/h3>\n\n\n\n<p>Go to your project folder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/path\/to\/your\/project\n<\/code><\/pre>\n\n\n\n<p>Start Codex:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>codex\n<\/code><\/pre>\n\n\n\n<p>On first run, it will ask you to sign in using your <strong>ChatGPT account<\/strong> or an <strong>OpenAI API key<\/strong>. (<a href=\"https:\/\/developers.openai.com\/codex\/cli\">OpenAI Developers<\/a>)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Upgrade later<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo npm i -g @openai\/codex@latest\n<\/code><\/pre>\n\n\n\n<p>That is the official upgrade command for npm installs. (<a href=\"https:\/\/developers.openai.com\/codex\/cli\">OpenAI Developers<\/a>)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Common errors<\/h3>\n\n\n\n<p>If you get:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>codex: command not found\n<\/code><\/pre>\n\n\n\n<p>Try:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm bin -g\n<\/code><\/pre>\n\n\n\n<p>Then make sure that global npm path is in your <code>PATH<\/code>.<\/p>\n\n\n\n<p>If install fails with permission errors, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo npm i -g @openai\/codex\n<\/code><\/pre>\n\n\n\n<p>or install Node through a user-level Node manager and then run npm without <code>sudo<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Important note<\/h3>\n\n\n\n<p>On Linux, use <strong>Codex CLI<\/strong>. The official Codex desktop app is currently listed for <strong>macOS and Windows<\/strong>, while the CLI is the Linux-supported option. (<a href=\"https:\/\/developers.openai.com\/codex\/quickstart\">OpenAI Developers<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To install OpenAI Codex CLI on Linux, use the npm method. The official Codex docs say the CLI supports Linux, [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3525","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/3525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=3525"}],"version-history":[{"count":1,"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/3525\/revisions"}],"predecessor-version":[{"id":3526,"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/3525\/revisions\/3526"}],"wp:attachment":[{"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=3525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=3525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aiopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=3525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}