Deployment

Deployment

Pre-built images are available on the Docker Hub.

Notas needs a port and a password for its admin. You can verify it starts correctly via the following command, which sets the admin's password to admin:

docker run --rm -p 3000:3000 -e NOTAS_ADMIN_PASSWORD='$2b$10$nz4CXs.JY7zL31d2xM3LnuCxs6bCwHcMbwMYPcugj.zsh6ydXdxgO' butterhosting/notas

A more realistic setup mounts a local directory at /opt/notas/data, so your pages and uploads survive container restarts:

services:
  notas:
    image: butterhosting/notas
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - /host-data/notas:/opt/notas/data
    environment:
      # compose expands `$`, so every one is doubled
      NOTAS_ADMIN_PASSWORD: "$$2y$$05$$..."
      NOTAS_TIMEZONE: "Europe/Amsterdam"

Admin

The admin only manages users. Its password is a bcrypt hash, which you can create as follows:

htpasswd -nB admin

The above command will output a line of the form admin:<hash>. Please make sure to only pass the <hash> as NOTAS_ADMIN_PASSWORD (see below).

Environment vars

When starting Notas, the following environment variables can be specified.

VariableOptionsDescription
NOTAS_ADMIN_PASSWORDbcrypt hash (required)The admin's password
NOTAS_LOGGINGdebug, info, warn, error (default info)Specifies Notas' own logging level
NOTAS_TIMEZONEIANA time zone (default UTC)Specifies the timezone used by the server
NOTAS_UPLOAD_LIMITmegabytes (default 1024)The largest file that can be uploaded

Single sign-on

Besides its own login, Notas accepts an Authorization: Basic header with a user's username and password on every request, so a reverse proxy doing single sign-on can log users in by adding it.

/data/

The /opt/notas/data/ directory stores Notas' internal SQLite database and every uploaded file.

Losing the data/ directory means losing all of your pages, so it's strongly recommended to mount /opt/notas/data/ as a persistent volume.

Backups

Make sure the /data/ directory mentioned above is mounted as a host directory, for example -v /host-data/notas:/opt/notas/data. Backups are then straightforward:

  1. Stop the Notas container
  2. Copy the entire data directory to your backup destination, for example rsync -a /host-data/notas/ /host-backups/notas/
  3. Start the Notas container

Restores are the same steps in reverse:

  1. Stop the Notas container
  2. Replace the entire data directory with the backup, for example rsync -a --delete /host-backups/notas/ /host-data/notas/
  3. Start the Notas container

Two things matter in both directions: Notas must stay offline for as long as the copy runs, and the /data/ directory is always copied or replaced in its entirety. Previous backups must be restored into the same or a newer version of Notas.