|
| 1 | +--- |
| 2 | +sidebar_position: 0 |
| 3 | +slug: /Configuration |
| 4 | +title: Configuration Guide |
| 5 | +description: Configure Stirling-PDF using environment variables, settings files, or in-app settings |
| 6 | +--- |
| 7 | + |
| 8 | +# Configuration Guide |
| 9 | + |
| 10 | +Stirling-PDF can be configured in three ways, depending on your deployment and preferences. |
| 11 | + |
| 12 | +## Configuration Methods |
| 13 | + |
| 14 | +### 1. In-App Settings (Recommended) |
| 15 | + |
| 16 | +If you have login enabled, admins can configure everything through the Settings menu in the application. |
| 17 | + |
| 18 | +**To use:** |
| 19 | +1. Set `SECURITY_ENABLELOGIN=true` |
| 20 | +2. Log in as admin |
| 21 | +3. Go to Settings → configure through UI |
| 22 | +4. Changes apply immediately, no restart needed |
| 23 | + |
| 24 | +**Best for:** Production deployments with admin users |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +### 2. Environment Variables |
| 29 | + |
| 30 | +Configure via Docker environment variables or system environment variables. |
| 31 | + |
| 32 | +**To use:** |
| 33 | +```bash |
| 34 | +docker run -d \ |
| 35 | + -e SECURITY_ENABLELOGIN=true \ |
| 36 | + -e LANGS=en_GB \ |
| 37 | + stirlingtools/stirling-pdf:latest |
| 38 | +``` |
| 39 | + |
| 40 | +**Best for:** Docker deployments, infrastructure-as-code, initial setup |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +### 3. Settings File (settings.yml) |
| 45 | + |
| 46 | +Edit `/configs/settings.yml` directly for advanced configuration. |
| 47 | + |
| 48 | +**To use:** |
| 49 | +```yaml |
| 50 | +security: |
| 51 | + enableLogin: true |
| 52 | +system: |
| 53 | + defaultLocale: en-GB |
| 54 | +``` |
| 55 | +
|
| 56 | +**Best for:** Complex configurations, when you prefer file-based config |
| 57 | +
|
| 58 | +--- |
| 59 | +
|
| 60 | +## Common Settings |
| 61 | +
|
| 62 | +### Authentication |
| 63 | +
|
| 64 | +Enable user login: |
| 65 | +```bash |
| 66 | +SECURITY_ENABLELOGIN=true |
| 67 | +SECURITY_INITIALLOGIN_USERNAME=admin |
| 68 | +SECURITY_INITIALLOGIN_PASSWORD=changeme123 |
| 69 | +``` |
| 70 | + |
| 71 | +Default credentials: `admin` / `stirling` (change immediately after first login) |
| 72 | + |
| 73 | +### Language & Localization |
| 74 | + |
| 75 | +```bash |
| 76 | +LANGS=en_GB # Available languages |
| 77 | +SYSTEM_DEFAULTLOCALE=en-GB # Default language |
| 78 | +``` |
| 79 | + |
| 80 | +### Deployment Mode |
| 81 | + |
| 82 | +```bash |
| 83 | +MODE=BOTH # Options: BOTH, FRONTEND, BACKEND |
| 84 | +``` |
| 85 | + |
| 86 | +### File Upload Limits |
| 87 | + |
| 88 | +```bash |
| 89 | +SYSTEM_MAXFILESIZE=2000 # MB |
| 90 | +SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE=2000MB |
| 91 | +SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE=2000MB |
| 92 | +``` |
| 93 | + |
| 94 | +### Memory Management |
| 95 | + |
| 96 | +```bash |
| 97 | +JAVA_TOOL_OPTIONS="-Xms512m -Xmx4g" # Min 512MB, Max 4GB RAM |
| 98 | +``` |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## Specialized Configuration Guides |
| 103 | + |
| 104 | +For advanced features and specific use cases, see these detailed guides: |
| 105 | + |
| 106 | +### Authentication & Security |
| 107 | + |
| 108 | +**[Single Sign-On (SSO)](./Single%20Sign-On%20Configuration.md)** |
| 109 | +- OAuth2 (Google, GitHub, Keycloak, OIDC) |
| 110 | +- SAML2 (Okta, Azure AD) - Pro/Enterprise only |
| 111 | +- Complete configuration examples |
| 112 | + |
| 113 | +**[System and Security](./System%20and%20Security.md)** |
| 114 | +- Split deployment (frontend/backend separation) |
| 115 | +- CORS configuration |
| 116 | +- Server certificates |
| 117 | +- JWT configuration |
| 118 | + |
| 119 | +**[Fail2Ban Integration](./Fail2Ban.md)** |
| 120 | +- Protect against brute-force attacks |
| 121 | +- Auto-ban after failed login attempts |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +### Features & Customization |
| 126 | + |
| 127 | +**[UI Customization](./UI%20Customisation.md)** |
| 128 | +- Branding and logos |
| 129 | +- Theme customization |
| 130 | +- Custom styling |
| 131 | + |
| 132 | +**[Endpoint/Feature Control](./Endpoint%20or%20Feature%20Customisation.md)** |
| 133 | +- Enable/disable specific tools |
| 134 | +- Control feature availability by user/role |
| 135 | + |
| 136 | +**[Pipeline (Automation)](./Pipeline.md)** |
| 137 | +- Automated workflows |
| 138 | +- Folder scanning |
| 139 | +- Batch processing |
| 140 | +- Multi-step operations |
| 141 | + |
| 142 | +--- |
| 143 | + |
| 144 | +### Integration & Storage |
| 145 | + |
| 146 | +**[External Database](./External%20Database.md)** |
| 147 | +- PostgreSQL configuration (Pro/Enterprise) |
| 148 | +- Database migration |
| 149 | +- Backup strategies |
| 150 | + |
| 151 | +**[Google Drive File Picker](./Google%20Drive%20File%20Picker.md)** |
| 152 | +- Direct Google Drive integration |
| 153 | +- OAuth setup |
| 154 | + |
| 155 | +**[OCR Configuration](./OCR.md)** |
| 156 | +- Tesseract language packs |
| 157 | +- OCR optimization |
| 158 | + |
| 159 | +**[Usage Monitoring](./Usage%20Monitoring.md)** |
| 160 | +- Prometheus metrics (Pro/Enterprise) |
| 161 | +- Application monitoring |
| 162 | +- Performance tracking |
| 163 | + |
| 164 | +--- |
| 165 | + |
| 166 | +### Other Configuration |
| 167 | + |
| 168 | +**[Folder Scanning](./FolderScanning.md)** |
| 169 | +- Watch folders for automatic processing |
| 170 | + |
| 171 | +**[Custom Signature Files](./Sign%20with%20custom%20files.md)** |
| 172 | +- Pre-loaded signatures for quick signing |
| 173 | + |
| 174 | +**[Extra Settings](./Extra-Settings.md)** |
| 175 | +- Logging configuration |
| 176 | +- Server settings (port, SSL/TLS) |
| 177 | +- Advanced Spring Boot settings |
| 178 | + |
| 179 | +--- |
| 180 | + |
| 181 | +## Configuration Priority |
| 182 | + |
| 183 | +When the same setting is defined in multiple places, this is the order of precedence (highest to lowest): |
| 184 | + |
| 185 | +1. **Environment Variables** |
| 186 | +2. **settings.yml / In-App Settings** |
| 187 | +3. **Default values** |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +## Environment Variable Format |
| 192 | + |
| 193 | +Convert YAML paths to environment variables: |
| 194 | + |
| 195 | +```yaml |
| 196 | +# settings.yml |
| 197 | +security: |
| 198 | + enableLogin: true |
| 199 | +``` |
| 200 | +
|
| 201 | +Becomes: |
| 202 | +```bash |
| 203 | +SECURITY_ENABLELOGIN=true |
| 204 | +``` |
| 205 | + |
| 206 | +**Rules:** |
| 207 | +- Uppercase everything |
| 208 | +- Replace `.` with `_` |
| 209 | +- Nested properties become `PARENT_CHILD` |
| 210 | + |
| 211 | +--- |
| 212 | + |
| 213 | +## Troubleshooting |
| 214 | + |
| 215 | +### Settings Not Applied |
| 216 | + |
| 217 | +1. Check configuration priority (env vars override settings.yml) |
| 218 | +2. Restart container after changing environment variables |
| 219 | +3. Check logs: `docker logs stirling-pdf | grep ERROR` |
| 220 | +4. Verify file permissions on `/configs` volume |
| 221 | + |
| 222 | +### Database Issues |
| 223 | + |
| 224 | +Default database location: `/configs/stirling-pdf-DB.mv.db` |
| 225 | + |
| 226 | +If missing: |
| 227 | +- Ensure `/configs` volume is mounted |
| 228 | +- Check write permissions |
| 229 | +- Review startup logs |
| 230 | + |
| 231 | +--- |
| 232 | + |
| 233 | +## Next Steps |
| 234 | + |
| 235 | +- **Production Deployment:** See [Production Deployment Guide](../Server-Admin-Onboarding.md) |
| 236 | +- **API Usage:** See [API Documentation](../API.md) |
| 237 | +- **Tool Reference:** See [Functionality](../Functionality/Functionality.md) |
0 commit comments