Set environment variables
Configure app settings and secrets on a Victus App Hosting server using Startup variables in the panel, plus how to read them from your code and when a restart is needed.
Environment variables are the clean way to configure an app without editing code — database credentials, API keys, ports and feature flags. On Victus, each server exposes its configurable variables in the Startup tab of the control panel. The egg defines which variables exist; you fill in the values.
Edit variables in the panel
- Open your server in the control panel and go to the Startup tab.
- Each field maps to an environment variable (for example PASSWORD, PORT, or a token).
- Enter your values and save.
- Restart the server from the Console for the new values to take effect.
Startup variables are injected when the process launches. Editing a value while the server is running does nothing until you Restart (or Stop then Start) from the Console.
App-defined variables via a file
If your framework expects variables the egg does not list (for example a custom Laravel or Node app), keep them in a .env file that you create in the Files tab. Load it at startup with a library like dotenv (Node/Python) — frameworks such as Laravel read .env automatically.
# .env in your project root (Files tab)
DB_HOST=your-db-host
DB_PORT=3306
DB_NAME=your_db
DB_USER=your_user
DB_PASSWORD=super-secret
APP_ENV=productionRead them in code
// Node.js
import 'dotenv/config';
const port = process.env.PORT || 3000;
const dbUrl = process.env.DB_HOST;
Keep .env files out of the public web root and out of any git repo you push. A token committed to a public repo is a leaked token — rotate it immediately if that happens.