Configuration
Casdoor is configured through separate files for the backend and frontend. This page documents all supported options.
Backend configuration (app.conf)
The backend reads a single config file: conf/app.conf. For a minimal setup, set driverName and dataSourceName for your database (see Configure database). The table below lists every option.
| Parameter | Default Value | Description |
|---|---|---|
appname | casdoor | Application name (currently has no practical use) |
httpport | 8000 | Port that the backend application listens on |
runmode | dev | Running mode: dev or prod |
copyrequestbody | true | Whether to copy request body for later use |
driverName | mysql | Database driver (e.g., mysql, postgres, sqlite). See Configure Database |
dataSourceName | root:123456@tcp(localhost:3306)/ | Database connection string. See Configure Database |
dbName | casdoor | Database name used by Casdoor |
tableNamePrefix | (empty) | Prefix for table names when using an adapter |
showSql | false | Show SQL statements in logger when log level is greater than INFO |
redisEndpoint | (empty) | Redis endpoint for session storage (e.g., localhost:6379). If empty, sessions are stored locally in ./tmp. For password: host:port,db,password |
defaultStorageProvider | (empty) | Default storage provider name for file uploads (e.g., avatars). See storage |
isCloudIntranet | false | Whether provider endpoints use intranet addresses |
authState | "casdoor" | Authorization application name checked during login |
socks5Proxy | "127.0.0.1:10808" | SOCKS5 proxy address for OAuth providers (Google, GitHub, etc.) that may be blocked |
verificationCodeTimeout | 10 | Verification code expiration time in minutes |
initScore | 0 | Initial score assigned to new users (used by Casnode, not Casdoor) |
logPostOnly | true | Whether to log only POST requests |
isUsernameLowered | false | Whether to convert usernames to lowercase |
origin | (empty) | Backend origin URL (e.g., https://door.casdoor.com) |
originFrontend | (empty) | Frontend origin URL if different from backend |
staticBaseUrl | "https://cdn.casbin.org" | CDN URL for static assets used during database initialization |
isDemoMode | false | Enable demo mode restrictions |
batchSize | 100 | Batch size for bulk operations |
enableErrorMask | false | Whether to mask detailed error messages |
enableGzip | true | Accept and respond with gzip encoding when client supports it |
inactiveTimeoutMinutes | (empty) | Auto-logout timeout in minutes. Empty or ≤0 means no timeout |
ldapServerPort | 389 | Port for LDAP server |
ldapsCertId | "" | Certificate ID for LDAPS connections |
ldapsServerPort | 636 | Port for LDAPS (LDAP over SSL) server |
radiusServerPort | 1812 | Port for RADIUS server |
radiusDefaultOrganization | "built-in" | Default organization for RADIUS authentication |
radiusSecret | "secret" | Shared secret for RADIUS authentication |
quota | {"organization": -1, "user": -1, "application": -1, "provider": -1} | Resource quotas (-1 means unlimited) |
logConfig | {"adapter":"file", "filename": "logs/casdoor.log", "maxdays":99999, "perm":"0770"} | Logging configuration (adapter, file path, rotation, permissions) |
initDataNewOnly | false | Whether to initialize data only for new installations |
initDataFile | "./init_data.json" | Path to data initialization file. See Data Initialization |
frontendBaseDir | "../cc_0" | Base directory for frontend files (only for development) |