Skip to main content

Manage multiple users

Manage User​

Click on your Avatar β†’ Admin area to navigate to your user panel.

The user panel is at the bottom of the page above the worker logs.

You can create, delete and manage users of your instance. You can change the scan path, password, name and e-mail of a given user.

Not released yet (comes after 1.7.0) If you use the Windows or Mac app without a password, LibrePhotos asks you to choose one for yourself before you can create a second user.

Not released yet (comes after 1.7.0) Setting a user's password here signs them out everywhere at once, and they sign in again with the new password. Your own password and e-mail address are changed in your profile, with your current password, not here. The same happens when a user changes their own password in their profile (their other sessions end, and the browser they used gets a new sign-in), when someone uses a password reset link, and when the password changes in any other way, manage.py changepassword included. Setting the password a user already has changes nothing, so a container start that runs createadmin --update with the same ADMIN_PASSWORD signs nobody out. An e-mail address you set here is trusted for single sign-on, see Which addresses are trusted. If the user was deleted while you edited them, saving answers that the user no longer exists instead of bringing the account back.

Not released yet (comes after 1.7.0) In the Django admin (/api/django-admin/) users cannot be added, a user's password hash and Email trusted are shown read-only, staff who are not superusers can neither open, change nor delete a superuser, only a superuser can change Superuser status, Staff status, groups and permissions of a user, and only a superuser can add, change or delete groups. Saving a user there writes only the fields you changed, and an e-mail address you change there is trusted for single sign-on. Failed sign-ins to the Django admin count like failed sign-ins to LibrePhotos, and its Change password page limits wrong old passwords like the profile does and signs you out everywhere else once the password changed.

New in 1.5.0 The circular arrow next to a user's scan directory scans that user's library now, the same scan as the Scan button on their Library page: the job is theirs and shows in their job list. While it runs, the arrow shows its progress. So after you fix a user's scan path, you can scan it without signing in as them. On your own Library page, Change photo folders in the Admin area under Scan library leads to this table. Not released yet (comes after 1.7.0) Up to 1.7.0 this link was called Change scan directories in the Admin area.

Please note: In LibrePhotos, the file system acts as the definitive source of photo organization. This means that folder structure dictates how photos are grouped and accessed within the application.

To isolate users and their photo collections, create a subfolder for each user inside the folder you set as scanDirectory in your .env file β€” the folder LibrePhotos mounts as /data. Inside LibrePhotos these show up as /data/user1, /data/user2, etc., and that is the path you assign as each user's scan directory. Create the folders before assigning them: LibrePhotos only accepts directories that already exist under /data. This ensures that users only see and interact with the photos in their designated directories.

New in 1.5.0 You can make such a folder in the user edit dialog: choose the folder it goes in, click New folder above the folder list, type its name and press Enter. The new folder is chosen as the scan directory right away. Only admins can make folders, only inside /data, and a name cannot hold / or \, be . or .., or be a name Windows refuses (such as CON or a:b). If LibrePhotos may not write to the folder, the dialog says so; then make the folder on the host.

Usernames​

Upper and lower case make no difference in a username: Anna and anna are the same name. People sign in with their name in any case, on the web, in the mobile and desktop apps, with Basic auth and in the Django admin.

Not released yet (comes after 1.7.0) New names are stored in lower case, however the account is made: first-time setup, self registration, Create user in the Admin area, createadmin, createuser and the first single sign-on login. A name that another account has in a different case is refused as already taken, also when you rename a user. A single sign-on login whose name is taken gets an account with another name and is never connected to the existing account because of its name. Renaming Anna to anna works. Accounts whose names have capitals keep them until you rename them; saving other changes to such a user does not change the name.

Signing in with your name​

Not released yet (comes after 1.7.0) The first-time setup only asks for a name and makes the username from it, see What is your name?. On the sign-in page you can type either of them: heinz or Heinz MΓΌller, in any case. This works for every account with a first or last name, also in the apps and with Basic auth. A username always goes first. When two accounts have the same name, for example father and son, the password decides. If their passwords are the same too, or if more than two accounts have the name, the name signs in nobody, and each of them uses the username. The full name counts, not parts of it. An admin sees every username in the Admin area under Users.

Names that differ only in case​

Up to 1.7.0, only the exact name was compared, so two accounts could have names that differ only in case, and the one with capitals could not sign in on the web any more. If your server has two accounts like that, both can sign in again after the upgrade:

  • The exact name is looked up first, so each of them gets into their own account by typing their name as it is shown in the Admin area.
  • If the password does not fit that account, it is tried on the other accounts of the same name, the lower-case one first and then the oldest. So both get in with any spelling, as long as their passwords differ.

Nothing is merged or renamed. Rename one of the two to end the confusion.

Not released yet (comes after 1.7.0) A public page (/public/Anna) opens under the name in any case, so a link that was copied with capitals or in lower case shows the same photos. When two accounts have such names, /public/Anna shows the photos of the account named exactly Anna, and /public/anna those of anna; a name with no exact match opens the lower-case account, then the oldest. Deactivated accounts are skipped, and only public photos are shown. Up to 1.7.0, the web app changed the name to lower case before asking for the page, so the public page of an account with capitals in its name was empty.

Not released yet (comes after 1.7.0) manage.py createuser <name> <email> --update sets the password of the account named exactly as you typed, and only then of another account of that name in a different case. Up to 1.7.0 it looked up the lower-case name, so it could change the password of a different account than the one you named.

Changing a user's scan directory​

Not released yet (comes after 1.7.0) The folder list in the edit dialog opens down to the user's current folder and still offers every other folder you may choose, also when the current one is gone, for example because its drive is not connected. The dialog can be saved while the folder is gone, as long as you do not change it. Up to 1.7.0 the list only showed the current folder and the folders in it; another folder had to be typed.

New in 1.5.0 When you point a user at another folder, their photos from the old folder stay theirs: nothing moves to another user. The edit dialog counts the user's photos outside the new folder and asks what to do with them before you save:

  • Keep them in the user's library (the default): nothing changes, as before.
  • Move them to the user's trash: after the save, a job (Trash photos outside the library, shown in the job list) moves them to the user's trash. The files on disk are not touched, and the user can restore the photos from the trash until it is emptied. The Save button turns red and says how many photos it moves.

Photos in the user's upload folder, in their further library folders and copies from their Nextcloud count as inside. If another user's scan directory holds the same files, that user's next scan adds them to their own library.

Scan directories of different users must not overlap. Every photo belongs to exactly one user, so LibrePhotos refuses a scan directory that is the same as, inside, or above another user's scan directory, and names the user it clashes with. In particular, once one user scans /data itself, no other user can be given any folder under /data, so give every user a folder of their own, the admin included. Installations that already have overlapping scan directories keep working and those users can still be edited; only changing a scan directory to one that overlaps is refused. Two users whose scan directories overlap each get their own photo of a file both scan, with its own thumbnails and face crops. New in 1.4.0 Up to 1.3.0 the second user's photo shared an internal key with the first user's, so either of them could be refused a photo of their own or see the other's rotation of it. LibrePhotos 1.4.0 repairs those photos once while it starts, copying their thumbnails and face crops, so the first start takes a little longer and the thumbnails folder grows by those copies.

If your admin account already scans /data and you want to add more users, move the admin's photos into a subfolder such as /data/admin, set that as the admin's scan directory and run a scan. The moved photos are matched to their existing entries by their content, so ratings, faces and albums are kept; see Missing Photos for how that relinking works.

Not released yet (comes after 1.7.0) Stop using this folder, under the folder list in the edit dialog, takes the folder away from the user once you save. The photos LibrePhotos already shows stay in their library and nothing in the folder is deleted, but LibrePhotos no longer looks for new photos there, and the user cannot upload. A scan that is running at that moment imports nothing more. A user with further library folders must give those up first. An admin finds the same button for their own folder under Settings β†’ Account and photo folder. Up to 1.7.0 a folder could only be replaced by another one.

Several library folders per user​

New in 1.5.0 A user's library can span more than one folder, for example a folder of their own and a shared family folder, or a second disk. The scan directory stays the user's main folder (uploads go below it unless an upload folder is set); further folders are added in the user edit dialog, under Library folders:

  1. Open the user in the Admin area and click Add folder under Library folders.
  2. Pick a folder in the tree (or type its path) and click Add folder. It must already exist under /data.
  3. Run a scan: every scan reads all folders of the library from then on.

The same list is on that user's Library page; as an admin you can add and remove your own folders there. Adding or removing a folder in the dialog applies right away, without Save.

The rules for scan directories hold for every library folder: a folder may not be the same as, inside or above a folder of another user's library (scan directory, upload folder or a further folder), and the error names the user it clashes with. Within one library, folders may not overlap either: a folder inside the scan directory is already part of the library. A scan directory that would contain one of the user's further folders is refused until you remove that folder.

Not released yet (comes after 1.7.0) The rules also hold when two admins change folders at the same time: the check and the change are made one at a time, so the second change is refused when it clashes with the first. Up to 1.7.0, two changes made at the same moment could both pass and leave two users with overlapping folders.

Remove… in a folder's menu takes it out of the library. Its files stay on disk and its photos stay the user's, outside the library; tick Also move its photos to the user's trash to move them to the trash right after, as when the scan directory changes. The main folder is not removed here: choose another photo folder in the edit dialog, or Stop using this folder once the further folders are removed.

Not released yet (comes after 1.7.0) While its photos are moved to the trash, each one is checked again: if you add the folder back, set the scan directory back, or move photos into the library meanwhile, those photos stay. A photo that is being moved to another folder at that moment is left alone, too. The result of the job, in the job list, says how many photos went to the trash (trashed_count) and how many are still outside the library (still_outside_count). Up to 1.7.0, every photo that was outside when the job started went to the trash.

Not released yet (comes after 1.7.0) A scan that is running when you change a user's scan directory, upload folder or library folders imports nothing from a folder that is no longer in the library. The scan's entry in the job list then says how many files it did not import for that reason. Up to 1.7.0, it imported the files it had already found in the old folder.

A folder that cannot be read (an unplugged disk) is shown as Not found and skipped by scans; its photos are not marked missing.

Every user can also leave subfolders out of their own library, from the Library page; see Leaving subfolders out.

To let several users see the same photos, keep the photos in one user's library and share them from there: albums and individual photos can be shared with other users on the instance, see Sharing. Sharing photos in a family compares the setups a household can use.

While the application saves metadata (e.g., tags, albums, facial recognition data) on a per-user basis in its database, it doesn’t inherently restrict access to the photos themselves. Access permissions must be managed through the file system / paths.

The separation will also not keep the photos "private" as the admin of the host system can see all the images.

Deleting a user​

The red trash icon in a user's row deletes that account. Admin accounts cannot be deleted, so the icon is greyed out for them.

Deleting a user removes the account, so it can no longer sign in, but it does not remove the user's library. Their photos, albums, tags and stacks stay in the database and are handed to a disabled placeholder account called deleted, which cannot sign in and is not listed in the Admin area. Nothing is removed from disk: the original files and their thumbnails stay where they are. If the photos should go as well, they have to be deleted from that user's library while the account still exists (see Trash).

Since 1.3.0, deleting a user also turns off everything of theirs that people without an account could open: public album links, photo links and public photos. Those links stop working for anyone who opens them. Nobody can sign in as deleted, so nobody could turn them off later. Links left on by users deleted with an older version are turned off when you upgrade to 1.3.0. Not released yet (comes after 1.7.0) That includes a link the user turns on while the deletion is still running.

Albums and photos the user shared with other users of the instance stay shared. Those users keep seeing them, now owned by deleted. Photos that other users shared with the deleted user are taken out of the deleted user's albums, so the people those albums are shared with cannot open them later. The photos stay in their owners' libraries.

A user deleted after another one can have an album or a tag with the same name as one that deleted already holds. Two albums are never mixed into one, so nobody gets to see one user's photos through the other user's shares:

  • An album the user made gets their username added to its title, for example Holiday (bob), and keeps its photos and the users it is shared with.
  • A generated album (an event, a day, a place or a thing) is dropped. Its photos are kept.
  • A tag is merged into the tag of the same name. Tags are not shared with anyone.

Not released yet (comes after 1.7.0) You can delete any number of users one after another. In 1.7.0 only the first user whose photos had been scanned for faces could be deleted: every later one answered with an error and stayed, also when the first one was deleted with an older version. Nothing was lost, and deleting the user again works after the update. The faces of all deleted users stay with their photos.

Two deleted users can have had photos of the same file, for example when a deleted user's folder was given to a new user who is deleted later too. Both photos stay, each with its own caption, people and shares, and everyone a photo is shared with goes on seeing and downloading the same file.

Upload folder​

Photos uploaded through the web interface or backed up by the mobile app are written to an uploads folder inside the user's scan directory: /data/user1/uploads/web/. The user edit dialog in the Admin area shows the folder uploads land in under the scan directory.

Since 1.3.0, you can put a user's uploads somewhere else: pick a folder in the Upload folder field of the same dialog. It is checked like a scan directory: it must already exist under /data, and it must not be inside, above or the same as another user's scan directory or another user's upload folder. A folder inside the user's own scan directory is fine. Uploaded photos are scanned into the uploader's library, so an upload folder counts as part of that user's files: the same rule also refuses a scan directory that is inside, above or the same as another user's upload folder, and the error names the user and whether it clashes with their library or their upload folder. As with scan directories, a value that already overlaps is kept when you save the user without changing it. Uploads then go to <upload folder>/web/. Clear the field to go back to the default.

Uploaded photos always belong to the user who uploaded them. If the upload folder is outside the user's scan directory, the photos still show up in their library, but a scan of the scan directory does not look in that folder and the folder view does not list it.

Giving each user their own folder automatically​

Admin area β†’ Site settings has a Create a folder for each new user switch, off by default. With it on, creating a user β€” from the admin panel, from self registration, or through single sign-on β€” also creates /data/<username> and assigns it as that user's scan directory, so you no longer have to make the folder on the host and assign it by hand for every account.

It only works when your own scan directory is a subfolder such as /data/admin, not /data itself. Scan directories of different users cannot overlap (see above), so while any user scans /data, every /data/<username> folder is refused.

What it deliberately does not do:

  • It never overwrites a scan directory you typed on the create form. An explicit path wins.
  • It never fails account creation. If /data is read-only, the username does not name a plain folder (such as . or ..), or the folder would overlap a directory another user already scans, the account is still created β€” just without a scan directory β€” and the reason is written to the backend log. Nothing is created on disk in that case. Assign a directory by hand afterwards.
  • It does not give a self-registered or single sign-on account a folder that already exists. Otherwise anyone who can sign up could take over, say, /data/family just by choosing family as their username. Such an account is created without a scan directory instead. When you create a user in the admin panel and /data/<username> already exists, that folder is assigned, since you can see what is in it.
  • It does not touch existing users. Only accounts created while the switch is on get a folder.

User Registration​

Click on your Avatar β†’ Admin area to the user registration setting.

You can also activate user registration, where user can create an account themselves. They cannot change the path, which means the admin is still in full control.

Unless Create a folder for each new user is on, a self-registered account is created without a scan directory, so the new user sees an empty library and is told to contact their administrator if they try to scan or upload. After someone signs up, open the Admin area, edit their account in the user panel at the bottom of the page and set its scan path as described above.

How to change the admin password, when you can't log in​

Not released yet (comes after 1.7.0) In the Windows and Mac apps, click Choose a new one on this computer on the sign-in page of the computer where LibrePhotos runs, see If you forgot your password. Windows or your Mac asks if it is you.

If that does not work there, use a command. LibrePhotos can keep running. [username] is the name you sign in with. If you never had a password, leave out the name.

  • Windows: press Windows key + R, type cmd and press Enter. Go to the folder of LibrePhotos and run:

    start /wait librephotos.exe manage changepassword [username]
  • Mac: open Terminal and run:

    "/Applications/LibrePhotos Server.app/Contents/MacOS/LibrePhotos Server" manage changepassword [username]

The command asks for the new password twice. You do not see it while you type. Then sign in with your name and the new password. Without a name the command takes the only account, and lists the names if there are several.

On every other installation the person who runs LibrePhotos can set a new password for any account with the command manage.py changepassword. Not released yet (comes after 1.7.0) The sign-in page says so when no e-mail is set up. In Docker:

docker exec -it [backend container name] python manage.py changepassword [username]

Installed from source, run python manage.py changepassword [username] in apps/backend, with the same environment variables as LibrePhotos itself. The command asks for the new password twice, and everyone who was signed in with the old one has to sign in again.

With Docker there are two more ways:

    1. If your .env sets the admin credentials, the password is reset every time the backend container starts. The keys are userName, userPass and adminEmail (passed to the backend as ADMIN_USERNAME, ADMIN_PASSWORD and ADMIN_EMAIL), and both the username and password must be non-empty. They are not in the shipped librephotos.env template, so add them yourself β€” see Admin account variables for the full behaviour.
    1. If outgoing e-mail is configured on your instance, the login page shows a Forgot password? link that e-mails a reset link to the address on your account. This only works once e-mail is set up (Admin area β†’ Site settings β†’ Email) and the account has an e-mail address, so arrange both before you get locked out. Behind the bundled proxy, also set frontendBaseUrl in your .env (passed to the backend as FRONTEND_BASE_URL) so the emailed link points at your public address rather than the internal one.