|
How to Run Codex App Server as a Windows Service with AlwaysUp |
Automatically start OpenAI's Codex App Server whenever your computer boots and keep it running healthy 24/7 in the background — no need to log in
Last Updated on September 18, 2026
Codex App Server is OpenAI's back-end harness that powers agent applications.
It runs headless and accepts requests over the network, both of which make it ideal for running continuously as an always-available Windows Service.
To install and run Codex App Server as a Windows Service with AlwaysUp:
-
First, ensure that the Codex CLI starts from a command prompt and works as expected.
That's required to install it as a Windows Service.
For this tutorial, we deployed Codex with npm.
This is the command we use to start Codex in app server mode, listening locally on port 4500:
"C:\Users\[USER-NAME]\AppData\Roaming\npm\codex" app-server --listen ws://127.0.0.1:4500
Note: If you deployed Codex with npm like we did, you can choose to run the codex executable directly instead of going through Node.js.
This very lengthy command also worked in our setup:
"C:\Users\[USER-NAME]\AppData\Roaming\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\bin\codex.exe" app-server --listen ws://127.0.0.1:4500
But we'll stick with the simpler command line for this guide.
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to Codex.
You found this when you built your command line in step 1.
Note that we added the ".cmd" suffix to our path, to make it clear that we were invoking the Windows CMD script that launches Codex.
-
In the Arguments field, enter your parameters to Codex (again, from step 1).
-
In the Start the application field, select Automatically, but shortly after the computer boots.
This setting — which delays Codex by a couple of minutes after a reboot — will ensure that critical system services
(like networking and security) up and ready before AlwaysUp launches the server.
-
And in the Name field, enter the name that you will call the application in AlwaysUp.
We'll go with Codex App Server but feel free to specify another name if you like:
-
Move to the Logon tab and enter the user name and password of the Windows account where you installed Codex.
It's best to run in this account so that Codex and Node can find their settings:
-
Next, let's set up a
web server health check
to keep an eye Codex. If Codex ever stops responding, we want AlwaysUp to restart it.
-
On the Monitor tab, check the Whenever it fails a periodic sanity check box and click the Set button on the right:
-
In the Add Sanity Check window, select the Check that a web server is responding properly
option and click Next to proceed:
-
Enter the Codex health check URL. On our machine, where Codex is running on port 4500, that's:
http://127.0.0.1:4500/healthz
Click Next to continue.
-
On this page, specify how often AlwaysUp should ping the HTTP connection.
Every 5 minutes (the default) should be fine but feel free to have AlwaysUp check more or less often as you like.
After you're done, click Next to move on:
-
And finally, review and confirm your settings:
If everything looks good, click Add
to record your new sanity check and return to the Monitor tab.
-
We're done configuring Codex App Server so click the Save button to record your settings.
In a couple of seconds, an entry named Codex App Server (or whatever you called it) will show up in the AlwaysUp window.
At this point, Codex is installed as a Windows Service but it's not yet running. The state will be "Stopped":
-
To launch the service, choose Application > Start "Codex App Server".
The state swill transition to "Running" and Codex will start working in app-server mode:
Now is a good time to confirm that the app server is working as expected. For example, can you connect to it from a terminal?
That worked great on your machine:
-
That's it! Next time your computer boots, Codex App Server will start up immediately, in the background, without anyone needing to log on.
Please restart your machine and test that everything works properly after Windows comes back to life.
And please feel free to edit Codex App Server in AlwaysUp and explore the many other settings that may be appropriate for your environment.
For example, you can:
Codex App Server not working properly as a Windows Service?
Consult the AlwaysUp Troubleshooter — our online tool that can help you resolve the most common problems encountered when running an application as a Windows Service.
From AlwaysUp, select Application > Report Activity > Today to bring up an HTML report detailing the interaction between AlwaysUp and Codex CLI. The AlwaysUp Event Log Messages page explains what each message means.
Browse the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
Contact us and we will be happy to help!
|
Over 97,000 installations, and counting!
|
 |
|
Rock-solid for the past 20+ years!
|
Fully Compatible with 160+ Applications...
|