Skip to content

Self-hosting BazarPro

BazarPro is open source (MIT). With Docker Compose it runs on a single server – with its own database, HTTPS via Let’s Encrypt, and without you having to build anything. Allow about half an hour for the setup.

This guide describes BazarPro from version 2.0. From this version on, BazarPro has its own backend with a PostgreSQL database. If you still run an older version with Convex, follow the guide Moving from Convex.

You need:

  • a Linux server with Docker and Docker Compose, at least 2 GB RAM, with ports 80 and 443 reachable
  • a domain where you can create DNS records
  • an email account with SMTP access – BazarPro uses it to send the confirmation codes for sign-up and password reset

BazarPro has two modes. You choose them with BAZARPRO_MODE in the .env:

single (default) platform
For whom one association, daycare or school with its own bazaars many organizers on one site, like bazarpro.de
Home page name, logo and bazaars of the association BazarPro’s marketing page with all public bazaars
Creating bazaars administrators only every user
Approval of public bazaars not needed by administrators
“Organizer” role only for administrators and a bazaar’s team for everyone
Name in header and emails name of the association BazarPro

For the vast majority of installations, single is right. The data is the same in both modes, so you can switch later.

Service Purpose
traefik Receives all requests and fetches the HTTPS certificates from Let’s Encrypt.
app The BazarPro website.
backend The server logic under /api: sign-in, live updates, uploads, emails and recurring tasks such as reminder emails. Uploaded photos and logos live in the Docker volume bazarpro_files.
postgres The database (PostgreSQL) in the Docker volume bazarpro_postgres_data.
  1. Create a DNS record. Your domain must point to your server’s IP address, e.g. basar.example.org with an A record (and an AAAA record for IPv6). BazarPro needs no other names.

  2. Download the files. On the server, in a new folder:

    Terminal window
    mkdir bazarpro && cd bazarpro
    curl -O https://raw.githubusercontent.com/BazarPro/core/main/docker-compose.selfhost.yml
    curl -o .env https://raw.githubusercontent.com/BazarPro/core/main/.env.selfhost.example
  3. Enter your settings. Open the .env file and enter at least:

    • DOMAIN – your domain without https://, e.g. basar.example.org
    • POSTGRES_PASSWORD – a random password for the database, e.g. generated with openssl rand -hex 24. Set it once and don’t change it afterwards: the database takes it over on the first start.
    • ACME_EMAIL – your real email address; Let’s Encrypt warns you there about expiring certificates. Let’s Encrypt rejects example.org addresses like the one in the template, and you then get no certificate.
    • BAZARPRO_VERSION – the version you want to install. A new installation needs at least v2.3.0: older versions don’t create any categories, and without categories no bazaar can be created. All versions are listed under Releases.
    • BAZARPRO_MODE – single for one association (default) or platform, see above
    • ADMIN_EMAIL – the email address you’ll sign up with in a moment. This account automatically becomes administrator.
    • AUTH_SMTP_… and AUTH_EMAIL_FROM – the credentials of your email account. The address in AUTH_EMAIL_FROM must match this account, otherwise the emails end up in spam. In single mode, BazarPro uses your association’s name from the settings as the sender name.
  4. Start BazarPro.

    Terminal window
    docker compose -f docker-compose.selfhost.yml up -d

    On the first start it takes one or two minutes until all images are pulled. The backend creates the database tables meanwhile. You can follow the progress with:

    Terminal window
    docker compose -f docker-compose.selfhost.yml logs -f backend

    As soon as it says listening, the backend is ready. The website starts after that. If the browser shows 404 page not found or a certificate warning during the first few seconds, reload the page shortly afterwards.

  5. Create your account. Open your domain in the browser, click Sign up – with the address from ADMIN_EMAIL – and confirm it with the code from the confirmation email. As soon as the address is confirmed, your account is administrator. After reloading the page, you find the Admin area in the role switcher in the sidebar.

    The account only becomes administrator after confirmation. That way nobody can register the address for themselves beforehand.

  6. More administrators are added with:

    Terminal window
    docker compose -f docker-compose.selfhost.yml exec backend bazarpro-backend admin board@example.org

    The account must already be registered.

If your server already runs a reverse proxy such as Caddy, it occupies ports 80 and 443. BazarPro then works without Traefik. Your proxy takes care of HTTPS and forwards /api to the backend and everything else to the app. You don’t change the docker-compose.selfhost.yml for this.

  1. Create a second Compose file. If your proxy runs in Docker itself, create a docker-compose.proxy.yml next to the docker-compose.selfhost.yml:

    services:
    app:
    networks:
    default:
    proxy:
    aliases: [bazarpro-app]
    backend:
    networks:
    default:
    proxy:
    aliases: [bazarpro-backend]
    networks:
    proxy:
    external: true
    name: caddy_default # your proxy's network

    Enter your proxy’s network under name; docker network ls lists all networks. Be sure to keep default in the list: without that network the backend can’t find the database and stops with failed to lookup address information. You don’t need fixed container names.

  2. Start BazarPro without Traefik. Fill in the .env as described above. ACME_EMAIL must be set but isn’t used.

    Terminal window
    docker compose -f docker-compose.selfhost.yml -f docker-compose.proxy.yml up -d app backend postgres
  3. Set up the proxy. For Caddy it looks like this:

    basar.example.org {
    reverse_proxy /api/* bazarpro-backend:3000
    reverse_proxy bazarpro-app:8080
    }

    With other proxies you have to enable WebSockets for /api, otherwise live updates won’t work. Caddy does this on its own.

If your proxy runs directly on the server and not in Docker, the docker-compose.proxy.yml looks like this instead:

services:
app:
ports:
- '127.0.0.1:8080:8080'
backend:
ports:
- '127.0.0.1:3000:3000'

Your proxy then forwards to 127.0.0.1:3000 (/api) and 127.0.0.1:8080 (everything else). If one of the ports is taken, change the first number.

After the installation: set up your association

Section titled “After the installation: set up your association”

Before you create the first bazaar, set up two things as an administrator:

  1. Settings (Admin › Settings):

    • Name and logo of your association appear in the header, on the home page and in all emails.
    • The contact email is shown in the footer and on the contact page.
    • Under Home page you choose whether the home page shows an overview of all bazaars or leads straight to the current or next bazaar.
    • Web analytics with Plausible is optional, see below.
  2. Legal texts (Admin › Legal texts): imprint, privacy policy and terms are mandatory, and you as the operator are responsible for them. As long as you haven’t saved a text, BazarPro shows “This page has not been set up yet” on these pages.

    Load template gives you a draft in which you replace all placeholders in double square brackets, e.g. [[Name des Vereins]]. The admin overview warns you as long as placeholders are left. Every change is saved as a version.

The categories that bazaars and items choose from are already there. You can change and extend them under Admin › Categories.

Then, in the Organizer role, create your first bazaar, see Create a bazaar. In single mode, a public bazaar is visible immediately; no approval is needed.

BazarPro shows the app in German or English depending on the visitor’s browser; everyone can switch the language themselves.

BazarPro can count visitors with Plausible Analytics – without cookies. Plausible isn’t included in BazarPro: you need your own Plausible installation (Community Edition) or an account at plausible.io.

Turn web analytics on under Admin › Settings › Web analytics with Plausible: enter the domain and Plausible server, activate, save. No restart needed. Alternatively, you can set PLAUSIBLE_DOMAIN and PLAUSIBLE_API_HOST in the .env. The settings in the admin area take precedence. Web analytics only runs when both values are known.

If your privacy policy contains the line {{webanalyse}} (the template includes it), BazarPro automatically inserts a section about Plausible there while web analytics is active. If you use plausible.io, you also need a data processing agreement with the provider.

If you only want to test BazarPro, you can load sample data: several bazaars, items and accounts, including admin@bazarpro.de, user1@bazarpro.de (organizer) and seller@bazarpro.de (seller), all with the password 123456.

Terminal window
docker compose -f docker-compose.selfhost.yml exec backend bazarpro-backend seed

Optionally, users can sign in with their GitHub or Google account. Create an OAuth app with the provider and enter as the callback URL:

  • GitHub: https://<DOMAIN>/api/auth/oauth/github/callback
  • Google: https://<DOMAIN>/api/auth/oauth/google/callback

Client ID and secret go into the .env (AUTH_GITHUB_ID, AUTH_GITHUB_SECRET or AUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET). Then restart BazarPro, see below.

Mention sign-in via GitHub or Google in your privacy policy as well.

After every change to the .env and for an update to a new version – adjust BAZARPRO_VERSION first:

Terminal window
docker compose -f docker-compose.selfhost.yml pull
docker compose -f docker-compose.selfhost.yml up -d

The backend brings the database up to date with the new version on start. Your data is kept. Make a backup before an update anyway.

A backup consists of two files: a dump of the database (accounts, bazaars, items, sales) and an archive of the uploaded photos and logos. In the folder with the docker-compose.selfhost.yml:

Terminal window
docker compose -f docker-compose.selfhost.yml exec -T postgres \
pg_dump -U bazarpro --format=custom bazarpro > bazarpro-$(date +%F).dump
docker compose -f docker-compose.selfhost.yml exec -T backend \
tar -czf - -C /data/files . > files-$(date +%F).tar.gz

Keep the backup somewhere other than the server. Ideally, set up a daily cron job for it.

Restoring: The following commands replace all current data with the state of the backup. The backend is stopped briefly for it:

Terminal window
docker compose -f docker-compose.selfhost.yml stop backend
docker compose -f docker-compose.selfhost.yml exec -T postgres \
pg_restore -U bazarpro --clean --if-exists --no-owner -d bazarpro < bazarpro-2026-10-21.dump
docker compose -f docker-compose.selfhost.yml run --rm -T --no-deps --entrypoint sh backend \
-c 'find /data/files -mindepth 1 -delete && tar -xzf - -C /data/files' < files-2026-10-21.tar.gz
docker compose -f docker-compose.selfhost.yml start backend

For a look at the data, open an SQL console:

Terminal window
docker compose -f docker-compose.selfhost.yml exec postgres psql -U bazarpro