Server configuration¶
Configure a self-hosted Silex with environment variables.
Overview¶
Environment variables are the supported way to configure a self-hosted Silex — they control ports, URLs, connectors, limits and SSL, and cover the vast majority of setups. Start there.
To add GrapesJS editor plugins, you don't touch the server config — use the client config instead.
Silex also has an internal server config (the full SaaS setup: dashboard, onboarding, and the connectors wired from the env vars below). It ships with Silex and is loaded automatically — you don't edit it.
Prerequisites¶
- A running Silex server (Docker, Node, or self-hosted)
- Understanding of storage and hosting connectors
Environment variables¶
All environment variables are optional except SILEX_SESSION_SECRET (recommended for security).
Core server settings¶
| Variable | Default | Purpose |
|---|---|---|
SILEX_PORT |
6805 | Port the server listens on |
SILEX_HOST |
localhost | Hostname (0.0.0.0 for remote access) |
SILEX_PROTOCOL |
http | http or https (before reverse proxy) |
SILEX_URL |
${PROTOCOL}://${HOST}:${PORT} |
Public URL users visit |
SILEX_DEBUG |
false | Set to true for verbose logs and config reloading |
SILEX_SESSION_NAME |
silex-session | Session cookie name |
SILEX_SESSION_SECRET |
(none) | Random key for session encryption; min 32 chars |
Express request limits¶
For large file uploads or data:
| Variable | Default | Purpose |
|---|---|---|
SILEX_EXPRESS_JSON_LIMIT |
100mb | Max JSON body size |
SILEX_EXPRESS_TEXT_LIMIT |
100mb | Max text body size |
SILEX_EXPRESS_URLENCODED_LIMIT |
100mb | Max form-encoded body size |
The defaults above come from the shipped
.env.default. The Docker image overrides them to1mb/10mb/1mb— raise them there if you upload large assets.
SSL/HTTPS¶
For HTTPS without a reverse proxy:
| Variable | Default | Purpose |
|---|---|---|
SILEX_SSL_PORT |
(none) | HTTPS port (e.g., 443) |
SILEX_SSL_PRIVATE_KEY |
(none) | Path to private key file |
SILEX_SSL_CERTIFICATE |
(none) | Path to certificate file |
SILEX_FORCE_HTTPS |
false | Redirect HTTP to HTTPS |
SILEX_FORCE_HTTPS_TRUST_XFP_HEADER |
false | Trust X-Forwarded-Proto header from reverse proxy |
CORS and client config¶
| Variable | Default | Purpose |
|---|---|---|
SILEX_CORS_URL |
(none) | Allow requests from this origin (e.g., https://editor.example.com) |
SILEX_CLIENT_CONFIG |
(none) | Path to a client config file — see Client configuration to add GrapesJS plugins |
Connectors¶
| Variable | Default | Purpose |
|---|---|---|
STORAGE_CONNECTORS |
ftp | Comma-separated list: fs, gitlab, ftp |
HOSTING_CONNECTORS |
ftp,download | Comma-separated list: fs, gitlab, ftp, download |
SILEX_FS_ROOT |
<cwd>/silex/storage |
Path for the fs storage connector |
SILEX_FS_HOSTING_ROOT |
<cwd>/silex/hosting |
Path for the fs hosting connector |
FTP_STORAGE_PATH |
(none) | Root path on FTP server for storage |
FTP_HOSTING_PATH |
(none) | Root path on FTP server for hosting |
GITLAB_DISPLAY_NAME |
(none) | Display name for the primary GitLab connector |
GITLAB_DOMAIN |
(none) | GitLab instance domain (e.g., gitlab.com) |
GITLAB_CLIENT_ID |
(none) | OAuth application ID for GitLab |
GITLAB_CLIENT_SECRET |
(none) | OAuth application secret for GitLab |
GITLAB2_DISPLAY_NAME |
(none) | Display name for a second GitLab connector |
GITLAB2_DOMAIN |
(none) | Domain for the second GitLab instance |
GITLAB2_CLIENT_ID |
(none) | OAuth application ID for second GitLab |
GITLAB2_CLIENT_SECRET |
(none) | OAuth application secret for second GitLab |
See Storage connectors and Hosting connectors for how to choose connectors and set up GitLab OAuth.
NocoDB integration¶
Used only by the SaaS onboarding flow (
server/deploy) to store sign-ups. Not needed for self-hosting — leave unset and onboarding stays disabled.
| Variable | Default | Purpose |
|---|---|---|
NOCO_URL |
(none) | NocoDB instance URL |
NOCO_API_KEY |
(none) | NocoDB API key |
NOCO_TABLE |
(none) | NocoDB table name for website metadata |
Extending the server¶
The connectors and options above are driven entirely by environment variables — that is the supported way to configure an instance.
There is no supported way to inject custom server-side code or connectors into a Docker or from-source instance. Such code would have to require() Silex internals under dist/…, which are not a public API and change between releases. (The npm @silexlabs/silex package that made this possible is being phased out in favour of the Docker image and from-source builds.)
If the built-in connectors and environment variables don't cover your need:
- To extend the editor — blocks, panels, GrapesJS plugins — use the client config.
- For a new storage/hosting connector or server behaviour, open an issue or start a discussion. New connectors are added to Silex itself so everyone benefits.
Troubleshooting¶
Connectors not loading¶
Verify the environment variables are set:
At startup Silex logs each connector it adds (> Add storage connector from env var: …) — check the server logs to see what was actually loaded.
See also¶
- Client configuration — add GrapesJS editor plugins
- Storage connectors
- Hosting connectors
- How CMS works — CMS concepts