Installation
Pick the section that matches your machine. Each one ends at the same place: a web address and a setup token, which the first run section takes from there.
Putting it on the internet for the first time? Your own domain, start to finish walks through all of it in order: buying the domain, renting the server, pointing one at the other, installing, pm2, nginx, and HTTPS.
The one-line install
With Node.js 24 and git on the machine, one command installs Fotobogen:
npx fotobogen@latest
It asks which folder to put it in, fetches the newest release, installs its packages, builds it, and offers to start it. Then go on to the first run.
- It checks first. Node.js 24, git, and pnpm 10. If pnpm is missing it offers to install it; that is the only thing it installs outside the folder you name.
- It never installs into a folder that already exists. If the name is taken it says so before doing anything, and suggests a free one. To name the folder yourself:
npx fotobogen@latest fotobogen-live. - It does what the steps on this page do by hand, and nothing else. The npm package
fotobogenis only this installer, two small files with no dependencies; Fotobogen itself comes from GitHub with git, so updating from the admin works afterwards. - On a server, it ends by saying how to run the site under pm2 (its settings file,
ecosystem.config.cjs, is in every install) and how to install pm2 if it is missing. On a server managed by Laravel Forge it also says what nginx needs: the proxy, andclient_max_body_sizefor uploads. The sections below have the rest: a domain, HTTPS, nginx. - Other choices:
--release 1.7.0installs a particular version,--yesasks nothing, and--helplists everything.
It has been run for real on macOS, and its tests run on Linux. On Windows, follow the Windows steps for now. If a step fails, it says which, and how to carry on by hand from there.
Which way to install
The one-line install above covers a Mac, a Linux computer, and the first steps on a server without Docker. Each way, by hand:
| You have | Use | Result |
|---|---|---|
| A Mac, to try it or to run it at home | macOS | http://localhost:5150 |
| A Windows PC | Windows | http://localhost:5150 |
| A new DigitalOcean droplet, and no wish to use a terminal | The quick way | A public site with HTTPS |
| A new rented server (VPS) with nothing on it | Docker on a fresh VPS | A public site with HTTPS |
| A server set up by Laravel Forge | Docker on a Forge server | A public site behind Forge's nginx |
| A server set up by Laravel Forge, and you prefer no Docker | Forge with pm2 | A public site behind Forge's nginx |
| A Linux server, and you prefer no Docker | Linux without Docker, then nginx | A public site behind nginx |
| A droplet that already runs nginx and other sites | Either Forge route, with what to change in nginx | One more site beside the others |
| Docker on your own computer | Docker on your own computer | http://localhost |
What the machine needs
Fotobogen checks the machine every time it starts and refuses to run on one that cannot run it properly, saying what to fix. The memory figures below are what that check enforces; for disk it insists only on 500 MB free, and it does not count processors.
| Minimum | Recommended | |
|---|---|---|
| Processor | 1 virtual CPU, x64 or arm64 | 2 virtual CPUs |
| Memory | 1 GB, with 2 GB of swap | 2 GB or more |
| Disk | 10 GB | 25 GB or more, SSD, sized to your photographs |
| System | Ubuntu or Debian (a current LTS release), macOS, or Windows | |
| Software | Node.js 24 with pnpm 10, or Docker with Compose | |
- Memory. Fotobogen will not start with less than 900 MB available to it, and warns below 2 GB when there is no swap. It resizes one photo at a time to stay small: a 40-megapixel photo was processed inside a container limited to 1 GB, using about 250 MB at its peak.
- Building needs more than running. Installing from source takes more memory than the running site. On a 1 GB server add swap first (the commands are below). A server with a full 2 GB needs none (many sold as 2 GB report a little less; the check at the start says if swap is needed), and neither does a Docker install, which downloads an image that is already built.
- Disk. It will not start with less than 500 MB free and warns below 2 GB. Most of the space goes to your photographs as uploaded; the resized copies are smaller. A backup zip is about the size of your originals, so leave room for one.
- Other Linux distributions may well work but are reported as untested.
What has and has not been tested. Every change is installed, built, and tested on Ubuntu and on Windows, and a 1 GB memory limit was tested in Docker. A real 1 GB rented server, and Docker on Windows, have not been tried yet. If you can afford it, rent the 2 GB size.
macOS
For trying Fotobogen, or running it on a Mac at home. Works on Apple silicon and Intel.
- Install Node.js 24. Download the installer from nodejs.org, or, if you use nvm, run
nvm install 24. Check withnode --version; it should printv24and some more. - Install Fotobogen. In Terminal:
It asks for a folder name, offers to install pnpm if it is missing, fetches, installs, and builds Fotobogen, and offers to start it. Ifnpx fotobogen@latestgitis missing, macOS offers to install it; run the command again afterwards. - Starting it (or
pnpm startin its folder) checks the machine, then prints the address and a setup token:Fotobogen setup token: 3b213e46bd70894ad18f1357791b1f18 Open the site in a browser and enter this token to finish setup. Fotobogen is running. Open it in a browser on this computer: http://localhost:5150 Logging in works at that address, or over https.
By hand, without the installer, in place of step 2:
npm install -g pnpm@10
git clone https://github.com/cschweda/fotobogen.git
cd fotobogen
pnpm install
pnpm build
pnpm start
If pnpm install stops and says Node.js is too old, the terminal you are in is using an older version, even if a newer one is installed. With nvm, nvm use 24 switches the terminal you are in; nvm alias default 24 only affects terminals opened afterwards. nvm keeps tools separately for each version of Node.js, so install pnpm again after switching: npm install -g pnpm@10.
To install into a folder with another name, name it to the installer: npx fotobogen@latest fotobogen-live. By hand, give the name when you clone: git clone https://github.com/cschweda/fotobogen.git fotobogen-live, then cd fotobogen-live and carry on as above. Each folder is its own site with its own data; see several installs on one machine.
Leave that Terminal window open while you use the site; Control + C stops it, and pnpm start starts it again with everything as you left it. Go on to the first run.
To reach it from another device on your home network, use the Mac's name or address in place of localhost, for example http://my-mac.local:5150. You can look around the public site that way, but logging in works only over HTTPS or on localhost, so do the admin work on the Mac itself. From another computer you can borrow the Mac's localhost over SSH: run ssh -L 5150:localhost:5150 you@my-mac.local there, leave it open, and browse to http://localhost:5150.
Windows
Windows 10 or 11. No compiler or Visual Studio is needed. The one-line installer has not been tried on Windows yet, so these steps are by hand.
- Install Node.js 24 from nodejs.org, and Git from git-scm.com.
- Open PowerShell and install pnpm:
npm install -g pnpm@10 - Get Fotobogen and build it:
git clone https://github.com/cschweda/fotobogen.git cd fotobogen pnpm install pnpm build pnpm start - It prints the address,
http://localhost:5150, and the setup token. Go on to the first run.
If PowerShell refuses to run pnpm because scripts are disabled, run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once and try again.
One difference from macOS and Linux: Windows has no equivalent of the file permission Fotobogen uses to keep its secret key private to your user, so that file has the same permissions as the folder it is in. Keep the data folder somewhere only you can read.
Docker on a fresh VPS
For a newly rented server running Ubuntu, with nothing else on it. Fotobogen runs behind Caddy, which gets an HTTPS certificate for your domain by itself and renews it.
Before you start
- A server of the size above, and a way to log in to it with SSH.
- A domain name, with an A record pointing at the server's address. Set this first: Caddy cannot get a certificate until it has taken effect.
- Ports 80 and 443 open in the server's firewall.
Steps
- Install Docker, using Docker's own script, and let your user run it:
Log out and in again so the second line takes effect.curl -fsSL https://get.docker.com | sudo sh sudo usermod -aG docker $USER - On a 1 GB server, add swap (skip this with 2 GB or more):
sudo fallocate -l 2G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab - Get Fotobogen. Docker needs the repository's
docker-compose.ymland.env.sample, so clone it rather than using the one-line installer:git clone https://github.com/cschweda/fotobogen.git cd fotobogen mkdir -p data cp .env.sample .envmkdir -p datamatters: it makes the data folder belong to you instead of to root. - Edit
.env(nano .env) and set your domain by removing the#from this line and changing the name:
IfDOMAIN=photos.example.comid -uprints something other than1000, also setPUIDandPGIDto whatid -uandid -gprint. - Start it:
This downloads the published image (docker compose up -dghcr.io/cschweda/fotobogen) and Caddy, and starts both. Nothing is built on your server. - Read the setup token:
docker compose logs app
Open https://photos.example.com (your own domain) and go on to the first run.
Docker starts Fotobogen again by itself after a reboot. To update later: docker compose pull, then docker compose up -d.
To build the image yourself instead of downloading it, remove the # from # build: . in docker-compose.yml and add --build to the command. On a 1 GB server that needs the swap from step 2.
Docker on a Laravel Forge server
For a server that Laravel Forge set up. There, nginx already answers on ports 80 and 443 and Forge manages the certificate, so Fotobogen runs alone in Docker, listening only on the server itself, and Forge's nginx passes visitors to it.
- Install Docker on the server and let the
forgeuser run it. Log in asforgewith SSH:
Log out and in again. On a 1 GB server, add swap too.curl -fsSL https://get.docker.com | sudo sh sudo usermod -aG docker forge - Create the site in Forge with your domain, and install the repository
cschweda/fotobogeninto it (branchmain). If Forge offers to install Composer dependencies, decline; there are none. - Start Fotobogen. In the site's folder (
/home/forge/photos.example.com):
This downloads the published image; nothing is built on your server.mkdir -p data PUID=$(id -u) PGID=$(id -g) docker compose -f docker-compose.forge.yml up -d - Point nginx at it. In Forge, open the site's nginx configuration and paste in the blocks from
deploy/forge-nginx.conf, changing the two marked lines (a path and the port). - Issue the certificate in Forge (Let's Encrypt).
- Read the setup token:
docker compose -f docker-compose.forge.yml logs app
Fotobogen listens on 127.0.0.1:5150 only. If something else on the server uses that port, set PORT in a .env file in the site's folder and use the same number in the nginx configuration.
The deploy script. Paste deploy/forge-deploy.sh into Forge's Deploy Script box. Forge's Deploy button then downloads the newest published image and restarts Fotobogen with it.
Linux without Docker
For Ubuntu or Debian, running Fotobogen directly with Node.js, kept alive by pm2, behind nginx.
- Install Node.js 24. The simplest way is nvm: install it as its page describes, then
nvm install 24 npm install -g pnpm@10 pm2 - On a 1 GB server, add swap before building.
- Get, build, and start:
Answer no when the installer offers to start it; pm2 starts it instead. By hand, in place of the first line:npx fotobogen@latest fotobogen cd fotobogen pnpm fotobogen init pm2 start ecosystem.config.cjs pm2 logs fotobogengit clone https://github.com/cschweda/fotobogen.git, thenpnpm install --frozen-lockfileandpnpm buildin the folder.pnpm fotobogen initis optional: it asks for the port, the site's address, and demo mode, and writes.env. For one site there is nothing to edit inecosystem.config.cjs, which takes the port from.env. (It sets the data folder itself; to move that under pm2, change it in the file.) The last command shows the setup token. - Start it at boot: run
pm2 save, thenpm2 startup, and run the line that prints. - Put nginx in front of it, as in the next section.
To update: scripts/rebuild.sh, which pulls the new code, builds it, and reloads.
nginx in front of the app
Under pm2, Fotobogen listens on 127.0.0.1:5150, which only the server itself can reach. nginx answers the public and passes each request on. Save this as /etc/nginx/sites-available/photos.example.com, with your own domain:
server {
listen 80;
listen [::]:80;
server_name photos.example.com;
# The largest upload nginx lets through. Keep it equal to MAX_UPLOAD_MB.
client_max_body_size 50m;
# Once the site has its certificate: browsers that have visited use https from then on.
add_header Strict-Transport-Security "max-age=31536000" always;
location / {
# Where Fotobogen is listening.
proxy_pass http://127.0.0.1:5150;
proxy_http_version 1.1;
# The name the visitor asked for. Without this, saving in the admin is refused.
proxy_set_header Host $http_host;
# The visitor's own address, for the limit on wrong passwords.
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Whether the visitor used http or https.
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
}
Switch it on, check it, reload, and add a certificate with Certbot:
sudo ln -s /etc/nginx/sites-available/photos.example.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d photos.example.com
Visitors must reach the site over HTTPS, or logging in will not work.
| What you see | Cause |
|---|---|
502 Bad Gateway | Fotobogen is not running, or is on another port. Run pm2 status and pm2 logs fotobogen. |
| Saving in the admin says "This request did not come from this site" | The proxy_set_header Host $http_host; line is missing. |
413 Request Entity Too Large on upload | client_max_body_size is smaller than the file. Raise it and MAX_UPLOAD_MB together. |
| Logging in returns to the login page | The site is being used over http. |
Laravel Forge with pm2, no Docker
Fotobogen runs under pm2 as the forge user, and the nginx that Forge manages passes requests to it. This follows Forge's usual way of working but has not been tried on a Forge server yet.
- Create the site in Forge with your domain, as a project type with no PHP, and install the repository
cschweda/fotobogen(branchmain) into it. - Install Node.js 24, pnpm, and pm2 for the
forgeuser, over SSH:
On a 1 GB server, add swap first.curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash source ~/.nvm/nvm.sh && nvm install 24 && nvm alias default 24 npm install -g pnpm@10 pm2 - Build and start in the site's folder:
cd /home/forge/photos.example.com pnpm install --frozen-lockfile pnpm build pnpm fotobogen init pm2 start ecosystem.config.cjs pm2 logs fotobogenpnpm fotobogen initasks for the port, the site's address (https://photos.example.com), and demo mode, and writes.env; the pm2 file takes the port from there. The last command shows the setup token. - Make it start after a reboot:
pm2 save, thenpm2 startup, and run thesudocommand it prints. - Point nginx at it. In Forge, open the site's nginx configuration. Inside the
serverblock, replace thelocation /block with the blocks fromdeploy/forge-nginx.conf, changing the two marked lines. Delete Forge'slocation ~ \.php$,location = /favicon.icoandlocation = /robots.txtblocks if it wrote any: the last two answer from disk and hide Fotobogen's own. Leave the rest of what Forge wrote as it is. - Issue the certificate in Forge.
- Set the deploy script, so that Forge's Deploy button updates the site:
Thecd /home/forge/photos.example.com source ~/.nvm/nvm.sh git pull origin $FORGE_SITE_BRANCH pnpm install --frozen-lockfile pnpm build pm2 reload ecosystem.config.cjs --update-envsourceline matters: Forge runs the script without your login shell's setup, so Node.js would not be found without it.
An existing droplet with nginx: what to change
For a DigitalOcean droplet, or any server, that already runs nginx and other sites, managed by Laravel Forge or by hand. Fotobogen does not replace nginx or touch your other sites. It runs as one more program on a port of its own, reachable only from the server itself, and one site's nginx file is changed to pass requests to it.
| Part of the server | What changes |
|---|---|
| nginx itself, its main file, your other sites | Nothing |
| The firewall | Nothing. Fotobogen listens on 127.0.0.1, so its port is not opened to the internet. |
| The certificate | Issued the usual way: Forge's SSL tab, or Certbot |
| One site's nginx file | The six changes below |
The changes go in that site's server { ... } block. On Forge: the site, Edit Files, Edit Nginx Configuration. By hand: /etc/nginx/sites-available/photos.example.com.
| Change | Why |
|---|---|
1. Add client_max_body_size 50m; | nginx's own limit is 1 MB, which refuses nearly every photo with 413. Keep it equal to MAX_UPLOAD_MB (50 unless you changed it). Set here, it applies to this site only and wins over any server-wide value. |
2. Replace the location / { ... } block with one that has proxy_pass http://127.0.0.1:5150; | This is the pointer to the app. Use the port Fotobogen runs on: PORT in its .env, or 5150 if that is not set. A second Fotobogen site on the same droplet needs a different one. |
3. In that block: proxy_set_header Host $http_host; | Without it, saving anything in the admin answers "This request did not come from this site". |
4. In that block: proxy_set_header X-Forwarded-Proto $scheme; and proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | So Fotobogen knows the visitor used https, and counts wrong passwords by visitor and not all against nginx. |
5. In that block: proxy_http_version 1.1; and proxy_read_timeout 120s; | A large upload takes longer to arrive and be checked than nginx's 60 seconds. |
6. Remove the location ~ \.php$ { ... } block, if the site has one | Fotobogen has no PHP. Harmless if left, but nothing uses it. |
Leave everything else as it is: the listen lines, server_name, the certificate lines, and on Forge every include forge-conf/... line. The root line can stay; it is no longer used.
Changes 1 to 5, ready to paste:
client_max_body_size 50m;
add_header Strict-Transport-Security "max-age=31536000" always;
location / {
proxy_pass http://127.0.0.1:5150;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
deploy/forge-nginx.conf is the same with one addition: nginx serves the resized photos from disk itself. Forge checks the file and reloads nginx when you save. By hand: sudo nginx -t, then sudo systemctl reload nginx.
On the app's side
Two settings go with the proxy. Both are already set in ecosystem.config.cjs, and the Docker files have the same effect.
HOST=127.0.0.1, so only nginx can reach the app.TRUST_PROXY=1, so the app believes the headers in change 4. Set it only when the app really is reachable through nginx alone.
Also set the site's address, as SITE_URL=https://photos.example.com in .env or under Search and sharing in the admin, so links to your photos begin with your domain.
When you change something later
| You change | Also change |
|---|---|
The app's port (PORT in .env) | proxy_pass in the nginx file; reload nginx, then pm2 reload ecosystem.config.cjs --update-env |
MAX_UPLOAD_MB | client_max_body_size, to the same number |
| The domain | The site and certificate in Forge (or server_name and Certbot), and SITE_URL |
| Fotobogen's version (an update) | Nothing in nginx |
Room on the droplet. Running, Fotobogen used about 130 MB of memory when measured idle, and uses more while it resizes photos (the pm2 file restarts it at 600 MB). Building it (an install or update without Docker) needs about 2 GB counting swap, for a few minutes; on a small droplet, add swap first, or use the Docker image, which is already built.
The admin at its own address
Normally the admin is part of the site, at /admin. It can instead be given a name of its own, such as admin.photos.example.com, with the public site staying at photos.example.com. It is optional, and worth doing if you switch on visitor statistics.
Why. A script from a counting service runs on your public pages, at your site's address. With the admin at the same address, a hostile or broken-into service could use a public page, open in a browser where you are logged in, to act as you. With the admin at its own name the browser keeps the two apart: your login is kept for the admin's name and never sent to the public one, and a script on a public page can neither read from the admin nor send to it.
- DNS: point
admin.photos.example.comat the server, like the site's own name. .env: set both, then restart.SITE_URL=https://photos.example.com ADMIN_HOST=admin.photos.example.com- The web server: make it answer for both names. In nginx:
server_name photos.example.com admin.photos.example.com;. On Laravel Forge: addadmin.photos.example.comas an alias of the site. With the Docker quick start: in.env, give both names,DOMAIN=photos.example.com, admin.photos.example.com, thendocker compose up -d. - The certificate: issue it again so that it covers both names. Forge and Certbot both ask which names; Caddy does it by itself.
What changes. You log in at https://admin.photos.example.com/login. /admin and /login at the public address lead there. The admin's API (/api/admin/…, used by API tokens) is at the admin's name too, so point any upload script at it. Public pages asked for at the admin's name lead back to the site. Photo addresses, the public API, and the feed do not change.
Fotobogen will not start with ADMIN_HOST set and SITE_URL missing, or with the two naming the same place, and says which.
Two smaller protections apply whether or not you do this: the admin and the login cannot be shown inside a frame, and when you log in, pages of your site open in other tabs load themselves again without the counting script.
Docker on your own computer
If you already use Docker Desktop, OrbStack, or Colima and would rather not install Node.js (Docker needs the repository's files, so this clones it rather than using the one-line installer):
git clone https://github.com/cschweda/fotobogen.git
cd fotobogen
mkdir -p data
cp .env.sample .env
Leave DOMAIN commented out in .env, then:
docker compose up -d
docker compose logs app
The site is at http://localhost. The image has been built and run on macOS. On Windows this needs Docker Desktop or WSL and has not been tested.
Several installs on one machine
The folder does not have to be called fotobogen, and one machine can hold as many installs as you like: fotobogen-live and fotobogen-test, or one for each client. Give the installer the folder's name:
npx fotobogen@latest fotobogen-live
By hand, git clone https://github.com/cschweda/fotobogen.git fotobogen-live does the same, and everything after it is unchanged.
Each folder is a complete site of its own: its own photos and database, its own login, its own settings, and its own version, updated by itself. Nothing in Fotobogen depends on the folder's name. What installs must not share:
| Each install needs its own | How |
|---|---|
| Folder | The name you give the installer (npx fotobogen@latest fotobogen-live) or git clone. |
| Port | Put PORT=5160 (any free port) in a .env file in its folder. Without one, a second copy started in a terminal asks whether to run beside the first, takes the next free port, and prints its address. |
| Data folder | Nothing to do: it is data inside the install's own folder. Never point two installs at one data folder. |
| pm2 name, on a server | Change name: 'fotobogen' in its ecosystem.config.cjs, to fotobogen-live, say. |
| Address, on a server | Its own domain and its own nginx server block, forwarding to its port (nginx in front of the app). |
On your own computer, a browser keeps one login for localhost, whatever the port. Logging in to the install at http://localhost:5160 logs you out of the one at http://localhost:5150. To be logged in to two at once, open the second at http://127.0.0.1:5160, which the browser counts as a different place, or use another browser or a private window. On a server each install has its own domain, and this does not arise.
Run the commands from the folder you mean: cd into it first and check with pwd. Cloning from inside an existing copy puts the new one inside the old.
Questions at the first start
The very first time you run pnpm start in a terminal, after the machine has been checked, Fotobogen asks three things the server has to know before it starts. Press Enter to accept what is suggested.
| Question | Enter means | What it sets |
|---|---|---|
| Port to run on? | 5150, or the next free port above it | PORT. A port you type is used exactly; one that is in use is refused, and you are asked again. |
| Site address? | Not set | SITE_URL, your site's address if it has a domain name. It can also be set in the admin. |
| Switch demo mode on? | No | DEMO_MODE. Only for a site meant to show Fotobogen off. |
The answers are saved to .env in Fotobogen's folder, and it does not ask again. To change them, edit that file, or run pnpm fotobogen init to be asked again; your other settings in .env are kept. Then restart.
On a server, the first start is usually under pm2, where nothing is asked. Run pnpm fotobogen init there before pm2 start to answer the same questions.
Nothing is asked when nobody is at the keyboard: under pm2, in Docker, on Laravel Forge, or from a script. Nor when .env already exists, or PORT, SITE_URL, or DEMO_MODE is already set. A server never waits for an answer. Nor when the CI variable is set. To switch the questions off in a terminal too, start with FOTOBOGEN_NO_QUESTIONS=1 pnpm start.
Whether to start with sample photos is asked in the browser, next.
In a terminal, the machine check and these questions are in colour: green for what is good, yellow for a warning, red for what stops the start. The words ok, WARN, and FAIL are always printed too. Colour is left out of log files, and NO_COLOR=1 switches it off.
The first run
However you installed it, you now have an address and a setup token: 32 letters and digits that Fotobogen printed when it started. The token proves that the person setting up the site is the person who can see the server.
- Open the address in a browser. A six-step wizard opens.
- Enter the token.
- Name your site, and give it a tagline if you like.
- Create the admin account: a username, and a password of at least 12 characters.
- Choose the grid (photos keeping their shape, or equal squares) and whether a photo opens over the grid or on its own page. Both can be changed later.
- Choose to start empty, or to download 25 sample photographs so there is something to look at. You can add or remove the samples later.
The wizard then closes for good and you are logged in. The first page you see asks you to confirm that backups are your responsibility. After that: using Fotobogen.
The token is printed at every start until setup is finished, and is also in the file data/setup-token. If you lose it, restart Fotobogen or read that file.
Settings on the server
Nothing has to be configured. Settings for one machine live in .env in Fotobogen's folder: the questions at the first start write it, or copy .env.sample to .env yourself. Edit it and restart. Docker reads the same file, but passes on only some of the settings (Configuration lists them).
| Setting | Default | What it does |
|---|---|---|
PORT | 5150 | The port. Left unset, a busy 5150 moves up to the next free port. Set, it is used exactly, and Fotobogen stops if it is taken. Under pm2 it is always set. |
DATA_DIR | ./data | Where the site keeps everything. |
ADMIN_HOST | none | A name of its own for the admin, such as admin.photos.example.com. Needs SITE_URL too. The admin at its own address has the steps. |
SITE_URL | none | Your site's proper address, such as https://photos.example.com. Used wherever a full address is written out: a photo's links in the admin, the feed, the sitemap, and what search engines are told. Without it, links made on your own machine begin with http://localhost:5150. It can also be set in the admin, under Search and sharing. |
DOMAIN | none | Docker quick start only: the domain Caddy gets a certificate for. |
PUID, PGID | 1000 | Docker only: the user and group that own the files in data. |
MAX_UPLOAD_MB | 50 | The largest file that can be uploaded. If you raise it, raise the limit in Caddy or nginx as well. |
MAX_MEGAPIXELS | 100 | The largest image, as width times height. |
Every other value is listed and explained on the configuration page.
Two copies on one machine. If Fotobogen is already running when you start it in a terminal, it asks whether to run both (the new one gets its own port), stop what is running, or cancel. Two copies must never share a data folder; pnpm start refuses when it can see the other copy (more in Questions).
Watching that it is up
The address /api/health needs no login and answers 200 when the site and its database are working, and 503 when they are not. Point UptimeRobot or a similar monitor at https://your-site.example/api/health.
Updating
Updating an installation you already run has a page of its own: how you hear that a new version is out, updating from the admin, updating by hand, and going back. In short: a copy installed with git updates from Admin, System; Docker updates with docker compose pull, then docker compose up -d.