--- title: 2. Penpot Configuration --- # Penpot Configuration This section explains the configuration options, both for self-hosting and developer setup.
Penpot is configured using environment variables and flags.
## How the configuration works Penpot is configured using environment variables and flags. **Environment variables** start withPENPOT_
. **Flags** use the format
-
.
Flags are used to enable/disable a feature or behaviour (registration, feedback),
while environment variables are used to configure the settings (auth, smtp, etc).
Flags and evironment variables are also used together; for example:
```bash
# This flag enables the use of SMTP email
PENPOT_FLAGS: enable-smtp
# These environment variables configure the specific SMPT service
# Backend
PENPOT_SMTP_HOST: enable-email-whitelist
flag. For backward compatibility, we
autoenable it when PENPOT_REGISTRATION_DOMAIN_WHITELIST
is set with
not-empty content.
Penpot also comes with an option to completely disable the registration process;
for this, use the following flag:
```bash
PENPOT_FLAGS: [...] disable-registration
```
This option is only recommended for demo instances, not for production environments.
### Authentication Providers
To configure the authentication with third-party auth providers you will need to
configure Penpot and set the correct callback of your Penpot instance in the auth-provider
configuration.
The callback has the following format:
```html
https://PENPOT_PUBLIC_URI
environment variable in case you go to serve Penpot to the users;
it should point to public URI where users will access the application:
```bash
# Backend
PENPOT_PUBLIC_URI: https://penpot.mycompany.com
# Frontend
PENPOT_PUBLIC_URI: https://penpot.mycompany.com
# Exporter
PENPOT_PUBLIC_URI: https://penpot.mycompany.com
```
If you're using the official docker-compose.yml
you only need to configure the
PENPOT_PUBLIC_URI
envvar in the top of the file.
If you plan to serve Penpot under different domain than `localhost` without HTTPS, you need to disable the `secure` flag on cookies, with the `disable-secure-session-cookies` flag. This is a configuration NOT recommended for production environments; as some browser APIs do not work properly under non-https environments, this unsecure configuration may limit the usage of Penpot; as an example, the clipboard does not work with HTTP.
## Email configuration By default,smpt
flag is disabled, the email will be
printed to the console, which means that the emails will be shown in the stdout.
Note that if you plan to invite members to a team, it is recommended that you enable SMTP
as they will need to login to their account after recieving the invite link sent an in email.
It is currently not possible to just add someone to a team without them accepting an
invatation email.
If you have an SMTP service, uncomment the appropriate settings section in
docker-compose.yml
and configure those
environment variables.
Setting up the default FROM and REPLY-TO:
```bash
# Backend
PENPOT_SMTP_DEFAULT_REPLY_TO: Penpot PENPOT_SECRET_KEY
envvar serves a master key from which other keys
for subsystems (eg http sessions, or invitations) are derived.
If you don't use it, all created sessions and invitations will become invalid on container restart
or service restart.
To use it, we recommend using a truly randomly generated 512 bits base64 encoded string here.
You can generate one with:
```bash
python3 -c "import secrets; print(secrets.token_urlsafe(64))"
```
And configure it:
```bash
# Backend
PENPOT_SECRET_KEY: my-super-secure-key
```
### Database
Penpot only supports PostgreSQL and we highly recommend >=13 version. If you are using official
docker images this is already solved for you.
Essential database configuration:
```bash
# Backend
PENPOT_DATABASE_USERNAME: penpot
PENPOT_DATABASE_PASSWORD: penpot
PENPOT_DATABASE_URI: postgresql://127.0.0.1/penpot
```
The username and password are optional. These settings should be compatible with the ones
in the postgres configuration:
```bash
# Postgres
POSTGRES_DATABASE: penpot
POSTGRES_USER: penpot
POSTGRES_PASSWORD: penpot
```
### Storage
Storage refers to storing the user uploaded assets.
Assets storage is implemented using "plugable" backends. Currently there are two
backends available: fs
and s3
(for AWS S3).
#### FS Backend (default)
This is the default backend when you use the official docker images and the default
configuration looks like this:
```bash
# Backend
PENPOT_ASSETS_STORAGE_BACKEND: assets-fs
PENPOT_STORAGE_ASSETS_FS_DIRECTORY: /opt/data/assets
```
The main downside of this backend is the hard dependency on nginx approach to serve files
managed by an application (not a simple directory serving static files). But you should
not worry about this unless you want to install it outside the docker container and
configure the nginx yourself.
In case you want understand how it internally works, you can take a look on the [nginx
configuration file][4] used in the docker images.
#### AWS S3 Backend
This backend uses AWS S3 bucket for store the user uploaded assets. For use it you should
have an appropriate account on AWS cloud and have the credentials, region and the bucket.
This is how configuration looks for S3 backend:
```bash
# Backend
AWS_ACCESS_KEY_ID: These settings are equally useful if you have a Minio storage system.
### Autosave By default, Penpot stores manually saved versions indefinitely; these can be found in the History tab and can be renamed, restored, deleted, etc. Additionally, the default behavior of on-premise instances is to not keep automatic version history. This automatic behavior can be modified and adapted to each on-premise installation with the corresponding configuration.You need to be very careful when configuring automatic versioning, as it can significantly impact the size of your database. If you configure automatic versioning, you'll need to monitor this impact; if you're unsure about this management, we recommend leaving the default settings and using manual versioning.
This is how configuration looks for auto-file-snapshot ```bash PENPOT_FLAGS: enable-auto-file-snapshot # Enable automatic version saving # Backend PENPOT_AUTO_FILE_SNAPSHOT_EVERY: 5 # How many save operations trigger the auto-save-version? PENPOT_AUTO_FILE_SNAPSHOT_TIIMEOUT: "1h" # How often is an automatic save forced even if the `every` trigger is not met? ``` Setting custom values for auto-file-snapshot does not change the behaviour for manual versions. ## Frontend In comparison with backend, frontend only has a small number of runtime configuration options, and they are located in the\/js/config.js
file.
If you are using the official docker images, the best approach to set any configuration is
using environment variables, and the image automatically generates the config.js
from
them.
In case you have a custom setup, you probably need to configure the following environment
variables on the frontend container:
To connect the frontend to the exporter and backend, you need to fill out these environment variables.
```bash
# Frontend
PENPOT_BACKEND_URI: http://your-penpot-backend:6060
PENPOT_EXPORTER_URI: http://your-penpot-exporter:6061
```
These variables are used for generate correct nginx.conf file on container startup.
## Other flags
There are other flags that are useful for a more customized Penpot experience. This section has the list of the flags meant
for the user:
- enable-cors
: Enables the default cors cofiguration that allows all domains
(this configuration is designed only for dev purposes right now)
- enable-backend-api-doc
: Enables the /api/doc
endpoint that lists all rpc methods available on backend
- disable-login-with-password
: allows disable password based login form
- enable-prepl-server
: enables PREPL server, used by manage.py and other additional
tools to communicate internally with Penpot backend. Check the [CLI section][5] to get more detail.
__Since version 1.13.0__
- enable-log-invitation-tokens
: for cases where you don't have email configured, this
will log to console the invitation tokens.
__Since version 2.0.0__
- disable-onboarding
: disables the onboarding modals.
- disable-dashboard-templates-section
: hides the templates section from dashboard.
- enable-webhooks
: enables webhooks. More detail about this configuration in [webhooks section][6].
- enable-access-tokens
: enables access tokens. More detail about this configuration in [access tokens section][7].
- disable-google-fonts-provider
: disables the google fonts provider.
[1]: /technical-guide/getting-started#configure-penpot-with-elestio
[2]: /technical-guide/getting-started#configure-penpot-with-docker
[3]: /technical-guide/developer/common#dev-environment
[4]: https://github.com/penpot/penpot/blob/main/docker/images/files/nginx.conf
[5]: /technical-guide/getting-started/#using-the-cli-for-administrative-tasks
[6]: /technical-guide/integration/#webhooks
[7]: /technical-guide/integration/#access-tokens