# Configuration

URL: https://rustpress.witsberry.com/configuration/

> Every rp-config.toml setting and environment variable for RustPress, with databases, connection strings, optional programs and server signals.

This page lists the settings in `rp-config.toml`, the environment variables that override them, and the signals a running server understands. Most sites never need to touch any of these: the setup wizard writes what’s needed.

## The site folder

The site folder (`--root`, `$RP_ROOT`, or the current folder) holds everything:

*   `rp-config.toml`: settings, created on first run with a fresh secret key
*   `rp-content/`: themes, plugins, uploads, logs, the AI workspace and, with SQLite, `database.sqlite`
*   `sdk/`: the plugin SDKs and `PROTOCOL.md`
*   `rp.pid`: the running server’s process ID

## Databases

| Database         | `database_url`                                      |
| ---------------- | --------------------------------------------------- |
| SQLite (default) | `sqlite://rp-content/database.sqlite`               |
| MySQL            | `mysql://user:password@127.0.0.1:3306/wordpress`    |
| MariaDB          | `mariadb://user:password@127.0.0.1:3306/wordpress`  |
| PostgreSQL       | `postgres://user:password@127.0.0.1:5432/wordpress` |

SQLite is right for most sites, including busy ones, and is one file to back up. For MySQL, MariaDB and PostgreSQL the database must already exist. Managed databases connect over TLS with `?sslmode=require` or `?sslmode=verify-full`. New sites name their tables `rp_posts`, `rp_options`…; set `table_prefix = "wp_"` to run on an existing WordPress database.

## Settings in rp-config.toml

| Setting               | Default                | What it does                                                                                                                |
| --------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `listen`              | `127.0.0.1:8080`       | Address and port; `--listen` overrides it                                                                                   |
| `database_url`        | SQLite in `rp-content` | See Databases above                                                                                                         |
| `table_prefix`        | `rp_`                  | Table prefix; a WordPress database usually uses `wp_`                                                                       |
| `content_dir`         | `rp-content`           | Themes, plugins, uploads                                                                                                    |
| `secret_key`          | Random                 | Signs logins and encrypts stored keys. Changing it logs everyone out                                                        |
| `disallow_file_mods`  | `false`                | Turn off installing and removing themes and plugins                                                                         |
| `disallow_file_edit`  | `false`                | Turn off the theme and plugin file editors                                                                                  |
| `safe_mode`           | `false`                | Run without plugins, on the default theme                                                                                   |
| `plugin_timeout_secs` | `10`                   | How long a plugin call may take                                                                                             |
| `plugin_memory_mb`    | `512`                  | A plugin service using more memory is restarted and flagged as a likely leak; `0` turns the check off                       |
| `php_binary`          | Found on PATH          | PHP program for PHP plugins                                                                                                 |
| `php_options`         | `[]`                   | Extra php.ini settings, e.g. `["opcache.jit=tracing", "opcache.jit_buffer_size=32M"]`                                       |
| `cache_url`           | Memory                 | Shared cache: `redis://`, `rediss://` (TLS), `valkey://`, `valkeys://`, `memcached://host:11211`                            |
| `queue_workers`       | `2`                    | Background job workers                                                                                                      |
| `background_cron`     | `true`                 | Run scheduled events and jobs inside the server                                                                             |
| `log_max_lines`       | `5000`                 | Lines per log file part                                                                                                     |
| `check_updates`       | `true`                 | Look for new releases twice a day                                                                                           |
| `trusted_proxies`     | `["127.0.0.1", "::1"]` | Proxies whose `X-Forwarded-For` is believed: addresses, ranges (`10.0.0.0/8`) or `private`; `[]` when nothing runs in front |
| `debug`               | `false`                | Extra diagnostics in the log                                                                                                |

Reload the server after editing the file: `sudo systemctl reload rustpress`, or send it `SIGUSR2`.

## Environment variables

| Variable                          | What it does                                                      |
| --------------------------------- | ----------------------------------------------------------------- |
| `RP_ROOT`                         | Site folder (instead of `--root`)                                 |
| `RP_DATABASE_URL`                 | Database (instead of `database_url`)                              |
| `RP_CACHE_URL`                    | Cache server (instead of `cache_url`)                             |
| `PORT`                            | Listen on `0.0.0.0:$PORT` (container platforms set it)            |
| `RP_LISTEN`                       | Address to listen on                                              |
| `RP_SECRET_KEY`                   | Secret key, 32 characters or more                                 |
| `RP_TRUSTED_PROXIES`              | Comma-separated proxies, ranges or `private`                      |
| `RP_TABLE_PREFIX`                 | Database table prefix                                             |
| `RP_FCGI_THREADS`                 | FastCGI worker threads (default 4 per CPU)                        |
| `RP_SAFE_MODE=1`                  | Safe mode                                                         |
| `RP_PHP`                          | PHP program for plugins                                           |
| `RP_PHP_PER_CALL=1`               | Start PHP for every plugin call instead of keeping it running     |
| `RP_TAILWIND`                     | Path to a `tailwindcss` program (offline servers)                 |
| `RP_LOG_QUERIES=1`                | Print every database query                                        |
| `RP_UPDATE_API`, `RP_UPDATE_REPO` | Where update checks look (default: GitHub, `Witsberry/RustPress`) |

## Site options you may want

Set these with `rp option set NAME VALUE`:

*   `rp_page_cache` (`0` turns the page cache off) and `rp_page_cache_ttl` (seconds, default 600)
*   `rp_minify` (`0` turns HTML and CSS minification off)
*   `siteurl` and `home` (the site’s address)

## Optional programs

| For                                 | Install                                                                                                                        |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Plugins written in PHP              | `php` 8.1 or later (`sudo apt install php-cli`)                                                                                |
| Plugins written in JavaScript       | Nothing for sandboxed plugins; Node 18 or later for `http` services                                                            |
| Plugins written in Python           | `python3`                                                                                                                      |
| Tailwind themes                     | Nothing: the Tailwind tool is downloaded once and checked                                                                      |
| AI agents through Claude Code       | Claude Code, logged in as the user RustPress runs as. It runs with only RustPress’s tools and none of the server’s environment |
| Building Rust plugins on the server | Rust with the `wasm32-unknown-unknown` target, and bubblewrap; builds are refused without the sandbox                          |

## Signals

| Signal                 | Effect                                                           |
| ---------------------- | ---------------------------------------------------------------- |
| `TERM`, `INT` (Ctrl+C) | Stop: finish requests in progress, stop plugin programs, exit    |
| `USR2`                 | Restart without downtime, with the new program file and settings |

Every command is in the [Command reference](/command-reference/).
