# Configuration
URL: https://usememos.com/docs/configuration

Memos can be configured through command-line flags, `MEMOS_*` environment variables, and instance-level settings managed in the UI or API.

## Common runtime settings [#common-runtime-settings]

| Flag                       | Environment                    | Purpose                                                          |
| -------------------------- | ------------------------------ | ---------------------------------------------------------------- |
| `--port`                   | `MEMOS_PORT`                   | HTTP port                                                        |
| `--addr`                   | `MEMOS_ADDR`                   | bind address                                                     |
| `--unix-sock`              | `MEMOS_UNIX_SOCK`              | Unix socket path                                                 |
| `--data`                   | `MEMOS_DATA`                   | data directory                                                   |
| `--driver`                 | `MEMOS_DRIVER`                 | database backend                                                 |
| `--dsn`                    | `MEMOS_DSN`                    | database connection string                                       |
| `--instance-url`           | `MEMOS_INSTANCE_URL`           | public instance URL                                              |
| `--demo`                   | `MEMOS_DEMO`                   | demo mode                                                        |
| `--allow-private-webhooks` | `MEMOS_ALLOW_PRIVATE_WEBHOOKS` | allow webhook URLs that resolve to private or reserved IP ranges |
| `--log-level`              | `MEMOS_LOG_LEVEL`              | log verbosity (`debug`, `info`, `warn`, `error`)                 |

## Configuration layers [#configuration-layers]

* runtime flags and environment variables control server startup
* instance settings control storage, registration, and some auth behavior
* reverse proxy settings affect HTTPS, cookie behavior, and public URL correctness

## Related topics [#related-topics]

* [Environment Variables](/docs/configuration/environment-variables)
* [Database](/docs/configuration/database)
* [Storage](/docs/configuration/storage)
* [Authentication](/docs/configuration/authentication)
* [Security](/docs/configuration/security)
