- Docker deployments
- CI/CD pipelines
- System-wide configuration
- Desktop app internal configuration
CLI flags take precedence over environment variables. See Server Options for CLI flag documentation.
Server Configuration
T3CODE_MODE
Sets the runtime mode.
web: Network mode with dynamic port allocationdesktop: Secure loopback mode for desktop app
T3CODE_PORT
Port number for the HTTP/WebSocket server (1-65535).
T3CODE_HOST
Network interface or IP address to bind to.Examples:
127.0.0.1- Local connections only0.0.0.0- All IPv4 interfaces::- All IPv6 interfaces- Specific IP (e.g.,
192.168.1.100)
T3CODE_STATE_DIR
Directory for storing state, database, and configuration files.
T3CODE_NO_BROWSER
Disable automatic browser opening on startup.
T3CODE_AUTH_TOKEN
Authentication token for WebSocket connections.
T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD
Automatically create a project for the current working directory on startup.
T3CODE_LOG_WS_EVENTS
Enable verbose logging for WebSocket events.
Development Variables
VITE_DEV_SERVER_URL
Development server URL for proxying to Vite dev server.Used during T3 Code development to enable hot module replacement. Not needed for normal usage.
T3CODE_DEV_INSTANCE
Instance identifier for development mode.When set, automatically shifts all ports by a deterministic offset based on the instance name. This allows running multiple development instances without port conflicts.
T3CODE_DEV_INSTANCE is used by T3 Code’s development scripts. It hashes the instance name to generate a port offset.T3CODE_PORT_OFFSET
Numeric port offset for development mode.Provides manual control over port shifting instead of using the hashed offset from
T3CODE_DEV_INSTANCE.Desktop App Variables
These variables are used internally by the desktop app and typically don’t need manual configuration.T3CODE_DESKTOP_WS_URL
WebSocket URL for desktop app to connect to the backend server.Automatically set by the desktop app during startup.
T3CODE_DESKTOP_UPDATE_GITHUB_TOKEN
GitHub token for accessing update releases.Used for accessing updates from private repositories during development.
T3CODE_DISABLE_AUTO_UPDATE
Disable automatic updates in the desktop app.Set to
1 to disable auto-updates.T3CODE_COMMIT_HASH
Git commit hash for version tracking.Automatically set during build. Used by the updater to determine the current version.
Docker Example
Configuration via environment variables is ideal for containerized deployments:docker-compose.yml
CI/CD Example
.github/workflows/test.yml
Systemd Service Example
/etc/systemd/system/t3code.service
Security Best Practices
Authentication Tokens
Authentication Tokens
- Use strong, randomly generated tokens
- Store tokens in secrets management systems
- Rotate tokens periodically
- Never commit tokens to version control
- Use different tokens for different environments
Network Binding
Network Binding
- Use
127.0.0.1for local-only access - Use
0.0.0.0with authentication for remote access - Consider using a reverse proxy (nginx, Caddy) with HTTPS
- Use firewall rules to restrict access
State Directory
State Directory
- Set appropriate filesystem permissions
- Keep state directory outside web root
- Back up state directory regularly
- Use separate state directories for different environments
Troubleshooting
Port Already in Use
Permission Denied for State Directory
Cannot Connect Remotely
Related
Server Options
CLI flags and detailed configuration
Keybindings
Customize keyboard shortcuts
