FotobogenDocumentation

Questions

Backups, starting over, and the things that go wrong.

Backups

Keeping a copy of your photographs is up to you. Fotobogen is free software, provided as it is, with no warranty. If the server fails, is deleted, or is broken into, and you have no backup, nobody can get your photographs back. Keep a backup somewhere other than the server, and keep your original files as well.

What is in a backup?

One zip file holding everything that cannot be made again: the database (titles, albums, tags, settings, your login), your photographs exactly as you uploaded them, and any skins and modules you installed. The resized copies are left out, because they are rebuilt from the originals. The secret key that seals logins is left out too, so a backup file cannot be used to log in as it stands. The two-step login key and backup codes are left out as well.

Keep a backup as private as the server. It holds every photo, hidden ones included, your settings, your webhooks' secrets, and your password in scrambled form. And only restore a backup you made yourself: it replaces the login and the API tokens with its own, and its modules are code. For that reason a backup uploaded through the admin is restored without its modules; restored on the server it installs them.

How do I make one?

In the admin: Admin, System, Download a backup. The site stays running. This works however Fotobogen was installed.

On the server, for an install without Docker:

pnpm fotobogen backup                      # writes fotobogen-backup-<date>.zip here
pnpm fotobogen backup /mnt/disk/site.zip   # or to a place you name

With Docker, run it in the container, where the data folder is /data; the file appears in your data folder:

docker compose exec app node scripts/fotobogen.mjs backup /data/site.zip

Or copy the data folder. Everything a site owns is in it. Stop Fotobogen first, so the database is not copied half-written, then copy the whole folder.

How often?

After every batch of uploads you would not want to do again. The backup is about as large as your original files, so on a large site, download it over a good connection or use the command on the server.

How do I restore?

A restore replaces the site's photos, database, and skins with the backup's, including the username and password. Two things stay as the site has them: two-step login (still on with the same key and codes, or still off), and, for a backup uploaded through the admin, the installed modules.

Use one of the server methods for any backup bigger than the upload limit (50 MB unless you raised it), which is most of them: the web server in front of Fotobogen refuses a bigger upload.

What was there is not deleted. It is moved into a folder named before-restore-<time> inside the data folder, so a mistaken restore can be undone by hand. Delete that folder when you are sure. After a restore the resized copies are made again in the background, and photos reappear on the site as each one finishes.

A backup that turns out to be damaged is refused and set aside as restore-failed-<time>.zip, and the site starts as it was. A backup made by a newer version of Fotobogen is refused until you update.

Starting over

There are several ways, from mild to complete. Pick the mildest one that does what you want.

Remove only the sample photos

On Overview, Remove sample photos deletes the 25 samples for good (they do not go to the trash), and the two sample albums if nothing else is in them. Nothing of yours is touched.

Remove all photos, keep the site

In the Library, press Select all, then Delete. That moves them to the trash, where they are kept for 30 days. To remove them now, choose Trash under Show, press Select all, then Delete for good. Your account, settings, skin, and albums stay.

Go back to an earlier state

Restore a backup.

Start again from nothing

Everything about a site is in its data folder. Without that folder, Fotobogen starts as a new installation: a new setup token, and the setup wizard. So: stop Fotobogen, move the folder out of the way, and start again.

Renaming the folder, instead of deleting it, keeps the old site in case you want it back.

Installed with Node.js (Mac, Windows, Linux):

# stop Fotobogen: Control + C in its window, or: pm2 stop fotobogen
mv data data-old          # Windows PowerShell: Rename-Item data data-old
pnpm start                # or: pm2 start fotobogen

Installed with Docker:

docker compose down
mv data data-old
mkdir -p data
docker compose up -d
docker compose logs app   # the new setup token

On a Forge server, add -f docker-compose.forge.yml after each docker compose.

When you are sure you do not want the old site, delete data-old. That deletes its photographs for good.

Put the old site back

Stop Fotobogen, move the new data aside, rename data-old to data, and start.

Reinstall the software, keep the site

The software and the site are separate. Updating, rebuilding, or cloning the source again does not touch data. To move to a fresh copy of the software, install it as new, stop it, and put your data folder in place of its empty one.

Remove Fotobogen completely

Take a backup if you want one. Stop Fotobogen (docker compose down, or pm2 delete fotobogen, or Control + C), then delete its folder. Nothing is installed anywhere else, apart from Docker's own images and volumes (docker compose down --volumes --rmi all removes those too) and a folder named .fotobogen in your home folder. It holds a small record of running copies and, if you ever set up two-step login, the server's key for it. It can be deleted too; the next Fotobogen you install there will then make a new key, and need a new entry in your authenticator app.

Getting in

I forgot the admin password

There is no reset by email, because Fotobogen sends no email. On the server:

pnpm fotobogen reset-admin                                        # without Docker
docker compose exec app node scripts/fotobogen.mjs reset-admin    # with Docker

It asks for a new password of at least 12 characters and signs out every session. Fotobogen does not need to be stopped. It changes the password only: if two-step login is on, it stays on.

Can I ask for a code from my phone as well as the password?

Yes: Admin, Two-step login. It is an option, off until you switch it on. You scan a QR code with an authenticator app (Google Authenticator, or any other), enter the six digits it shows, and are given ten backup codes to download. From then on, logging in takes the password and then a code. Nothing is sent by text message or email. The README has every detail.

I lost my phone, and the site asks for a code

Type one of your backup codes where the login page asks for the code. Each works once. Once in, Admin, Two-step login shows the QR code again for a new phone, and shows your backup codes again.

With no backup codes either, on the server:

pnpm fotobogen two-step off                                        # without Docker
docker compose exec app node scripts/fotobogen.mjs two-step off    # with Docker

It switches two-step login off and signs out every session. Log in with your password and switch it on again.

There is also pnpm fotobogen two-step key (with Docker, docker compose exec app node scripts/fotobogen.mjs two-step key), which prints the key this server keeps, to add to a new phone without logging in. A site whose data folder was copied here from another server still uses the key it came with; use two-step off there.

Will my authenticator app fill up with an entry for every site I install?

No. The key is kept once for the server, in .fotobogen in your home folder, and every Fotobogen you install there uses it. A site you delete and install again, or a second site beside the first, finds the key and asks only for a code from the entry you already have. The entry is named after the server, Fotobogen (your-server-name), so one from a server you no longer use is easy to recognise and delete. In Docker each site has a key of its own, and its entry is named after the site, unless you give the sites the same TWO_STEP_KEY in each one's .env.

I lost the setup token

It is printed every time Fotobogen starts, until setup is finished: restart it and read the output (docker compose logs app, or pm2 logs fotobogen). It is also in the file data/setup-token.

Logging in does nothing, or says my browser would not keep the login

The login is kept in a cookie that browsers accept only over https, or at an address that means "this computer": localhost, 127.0.0.1, or 0.0.0.0. Opened over plain http at any other address, such as http://192.168.1.20:5150 or http://my-mac.local:5150, the browser would throw the login away, so the login page refuses and says why. Use http://localhost:5150 on the machine itself, borrow it from another machine with ssh -L 5150:localhost:5150 you@that-machine, or put the site behind https.

It says too many attempts

Five wrong passwords in 15 minutes from one address locks that address out until the 15 minutes pass. Wait, or restart Fotobogen, which forgets the count. Resetting the password does not lift the lock.

With two-step login on there is a second limit: ten wrong codes for the account in 15 minutes, from any address, and no code is accepted until the 15 minutes pass. The message is "Too many wrong codes".

Running it

pnpm install stops and says Node.js is too old, but I installed Node.js 24

The terminal you are in is still using the older one. With nvm, run nvm use 24 in that terminal; nvm alias default 24 changes only terminals opened afterwards. Then install pnpm for that version, because nvm keeps such tools separately for each: npm install -g pnpm@10. If you had already installed under the older Node.js, delete the node_modules folder and run pnpm install again, since what was installed for one version does not work under another.

pnpm: command not found after switching Node.js

Run npm install -g pnpm@10. With nvm, each version of Node.js has its own set of tools.

It will not start, and prints "FAIL"

That is the check Fotobogen runs before every start. Each failing line says what is wrong and what to do: usually too little memory, too little disk space, an old version of Node.js, or a data folder it may not write to. Run pnpm preflight to see the whole report. The limits are on the installation page.

It started on port 5151, not 5150

Something else was using 5150, so it took the next free port and said so. To fix the port, set PORT in .env; then Fotobogen uses exactly that one, and stops with a message if it is taken.

Why 5150?

It is different enough from the ports everything else uses (3000, 8000, 8080) to be free on most machines. It is also a Van Halen album.

A photo says "failed"

Open it in the library (Library, filtered to Could not be processed). Its page says why and has a Try again button. The usual causes are a damaged file, or a server with too little free memory at that moment. The file you uploaded is still there.

An upload is refused as too large

The limit is 50 MB and 100 megapixels. Raise MAX_UPLOAD_MB or MAX_MEGAPIXELS in .env, and raise the limit of the web server in front of Fotobogen to match (max_size in deploy/Caddyfile, client_max_body_size in nginx). Larger photos need more memory.

I changed .env. Do I rebuild?

No. Restart Fotobogen and the new values are used: pnpm start again, pm2 restart fotobogen, or docker compose up -d. A rebuild (pnpm build) is needed only after updating the software or editing fotobogen.config.js. More about settings.

Can I let people look round the admin without letting them change anything?

Yes: demo mode. Put DEMO_MODE=1 in .env and restart. The login page then offers the username demo and the password demo. A demo visitor can open every admin page, but every attempt to save, upload, or delete is refused, and they cannot reach backups, API tokens, or webhooks. Your own login still has full control. What a demo visitor can and cannot see.

Can I update from the admin?

Yes, from version 1.1.0, if Fotobogen was installed with git (Updating has every case). When Admin, System finds a newer release it offers Update to version X: it saves a copy of the database, fetches and builds the new version, and restarts (under pm2) or asks you to restart. If anything fails, the old version is put back and built again. A Docker install is shown the commands to run on the server instead. More about updating.

An update failed. Is my site broken?

Usually not. An update that cannot be fetched changes nothing. When the new version cannot be installed or built, Fotobogen puts the old version back and builds it again, and the System page says what went wrong and keeps the output. Meanwhile the site that is running carries on. The exception: if building the old version fails as well, the page says so, and the site may not start after a restart until it is built by hand on the server (pnpm install, pnpm build). The usual cause of both is too little memory for the build: it needs about 2 GB, counting swap. Add swap (how) and try again. The copy of the database made before the update is in the data folder, named before-update-….

How do I move to another server?

Install Fotobogen on the new server, stop it, copy your data folder over its empty one, and start. Or download a backup from the old site and restore it on the new one; you will log in with the old site's account. Then point your domain at the new server.

Two-step login moves with a copied data folder. A site restored from a backup on a new server starts with it off, because a backup never holds the key: switch it on again there.

Can I run two sites on one server?

Yes: two copies of Fotobogen, each in its own folder with its own data, on different ports. Two copies must not share a data folder. pnpm start refuses a folder that another copy you started is using; it cannot see a copy run by another user, or two Docker containers given the same folder, so that part is up to you. Under pm2, give the second site its own PORT in its .env and its own name in its ecosystem.config.cjs.

What it does and does not do

Does it send my photographs or any information anywhere?

No. It makes three kinds of outside request, each only if you ask: downloading the sample photos, asking GitHub whether a newer version exists, and sending webhooks to addresses you enter. None of them carries your photographs or anything about your visitors.

Can I show my photos on another website? Do I need to set up CORS?

Yes, and no. Each photo's page in the admin has a Links panel with the address of every size of the picture and a line of HTML to paste. Showing a picture from another site never needs CORS, and for the stricter case of a script on another site reading the picture, Fotobogen sends Access-Control-Allow-Origin: * with photos and with its public API. Set your site's address first (Search and sharing, or SITE_URL), so the links do not begin with localhost.

Does it track visitors or set cookies?

It has no analytics of its own, and loads nothing from any other site unless you switch a counting service on under Admin, Visitor statistics (how); then visitors' browsers load that service's script, and what it stores is up to the service. A visitor gets one cookie, and only if they press the light and dark switch: the word light or dark. The admin's login is a second cookie, for you alone, and closing the note about a new version in the admin sets a third, also only for you.

Is where my photos were taken shown?

Not unless you switch it on in Settings. The copies visitors see carry no camera data at all, and with location off the copy they download carries none either. With location on, the download is the file exactly as you uploaded it, with everything the camera wrote into it.

Can several people have accounts?

No. There is one admin account.

Can visitors comment, or buy prints?

No. It publishes photographs; it has no comments, shop, or user accounts.

Can it run on Netlify, Vercel, or similar hosting?

No. It needs a disk that stays, for the database and the photographs, and those services do not give a site one. A small rented server does. (This website is on Netlify, but it is only these pages.)

Can it store photographs in S3 or similar?

Not yet. Storage is built so that this can be added, and it is on the roadmap.

Does my site have to be called Fotobogen?

No. Nothing a visitor sees says "Fotobogen". The site carries the title you give it, and every word on it can be changed under Admin, Site text. More about that.

What does the name mean?

Fotobogen is German for "photo sheet", as in a contact sheet: the page of small prints made from a roll of film.

Where do I report a problem?

On GitHub, under Issues.

Back: Writing a module Next: Security audits