CoCodex is a self-hosted control panel and service layer for Codex-oriented workflows.
It is designed for people who want a practical way to operate Codex at scale, with one place to manage accounts, access, and operational workflows.
CoCodex gives you a web admin interface and backend APIs to manage:
- OpenAI accounts and team workspaces
- API keys and system settings
- signup / relogin flows
- inbox and operational tooling around your Codex setup
- Install dependencies:
bun install- Create your local env file:
cp .env.example .envThen update .env with real values for your environment. At minimum, local development needs a working DATABASE_URL. For full functionality, also configure the required OpenAI, Cloud Mail, OAuth, and other provider credentials.
-
Start PostgreSQL.
-
Start the development environment:
bun run devDefault local endpoints:
- Web:
http://localhost:53332 - Backend:
http://localhost:53141
If you just want the stack running quickly, use Docker.
- Copy the Docker environment file:
cp .env.docker.example .env.docker- Update
.env.dockerif needed.
The default values are enough to boot the app and database locally. For real feature usage, you still need to provide the external service credentials your setup depends on.
- Start the stack:
bun run docker:up- Stop the stack:
bun run docker:downDefault ports:
- Web:
http://localhost:53332 - Backend:
http://localhost:53141 - PostgreSQL:
localhost:5432
The systemd units are under deploy/systemd.
They assume:
- Bun is installed under the runtime user's home directory
- the repository is located at
~/cocodex - the runtime env file is
~/cocodex/.env
The main service uses %h, so paths follow the configured User= automatically. In practice, you usually only need to check:
User=Group=WorkingDirectoryif your checkout directory is not~/cocodex
Install and enable:
sudo cp deploy/systemd/*.service /etc/systemd/system/
sudo cp deploy/systemd/*.timer /etc/systemd/system/
sudo cp deploy/systemd/*.target /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now cocodex.target
sudo systemctl enable --now cocodex-status-poll.timer
sudo systemctl enable --now cocodex-sync-openai-rate-limits.timerUseful commands:
sudo systemctl status cocodex.service
sudo journalctl -u cocodex.service -f
sudo systemctl list-timers 'cocodex-*'The deployment also includes two scheduled jobs running every 5 minutes:
status:pollsync:openai-rate-limits
The Docker setup is meant to be the fast path for getting the stack online locally or on a small server.
Files involved:
The compose stack starts:
- PostgreSQL
- backend
- web
To use it:
cp .env.docker.example .env.dockerThen edit .env.docker for your environment. In most cases you only need to care about:
DATABASE_URLAPP_BASE_URLNEXT_PUBLIC_APP_BASE_URLPORTAL_PUBLIC_ORIGINAPI_BASE_URLNEXT_PUBLIC_API_BASE_URL- any OpenAI / Cloud Mail / OAuth credentials you actually use
Start:
bun run docker:upStop:
bun run docker:downThe backend initializes the database schema automatically on startup, so you do not need a separate migration step just to boot the project.
MIT License
This project has been published in the LINUX DO community. Thanks to the community for the support and feedback.