Installing PrismGram next to PhotoPrism
PrismGram (the code and the server paths still say photogram) is an Instagram-style app for your PhotoPrism library: grid, map, calendar, trips, stories, insights, share links, offline mode, and (optional) Instagram likes/views matched to your photos. A demo with generated photos is at https://<your host>/demo/ (or /gram/demo/ on a classic install; static files, no account). It never changes PhotoPrism itself; you log in with your PhotoPrism account.
Requirements: PhotoPrism (CE is fine), a Linux server, Python 3.10+. Instagram matching and duplicates need PhotoPrism's SQLite index (with MariaDB the rest still works).
Get the files
curl -L https://prismgram.app/download/prismgram.tar.gz | tar xz && cd prismgram
The archive holds the app, the demo, the server scripts and the install files (a GitHub repository follows). To update later, download it again and rerun the same install step: your settings and data are kept.
Option A: script (PhotoPrism behind nginx)
sudo bash install/install.sh # DRY_RUN=1 bash install/install.sh shows what it would do
It asks for (and detects) the PhotoPrism folder, storage, import folder, address and nginx site, then: copies the app to /var/www/photogram, scripts to /opt/photogram, writes /opt/photogram/photogram.conf, adds include snippets/photogram.conf; to your PhotoPrism nginx site (backup + nginx -t, put back on failure), starts photogram-api (systemd) and installs the cron jobs. Open https://<your-domain>/gram/ (the public page) and log in at https://<your-domain>/gram/login — the public page itself has no login link; /gram/#login works too. Running it again updates the app and keeps your settings and data.
Option B: Docker (next to PhotoPrism's docker-compose)
Copy the service from install/docker/docker-compose.example.yml into PhotoPrism's docker-compose.yml, put a Photogram checkout in ./photogram, then docker compose up -d --build photogram. Open http://<server>:2343/gram/ (the container also passes PhotoPrism's API through, so log-in works on that address), or route /gram/ on your reverse proxy to photogram:8790. Enable PhotoPrism auto-import (PHOTOPRISM_AUTO_IMPORT: "300") so Instagram pictures you choose to import are picked up. Not in the container: server backups / monitoring (ops.py) and PhotoPrism updates; use the script install for those.
Option C: your own domain (what prismgram.app does)
The app can live at the root of its own domain while PhotoPrism stays where it is. Run Option A first (it installs the scripts, the service and the cron jobs), then on the same server:
- Copy the app files to
/var/www/prismgram/:cp -r index.html sw.js manifest.json *.png demo promo install /var/www/prismgram/. - Copy
install/nginx-prismgram.conf.exampleto/etc/nginx/sites-available/prismgram, replace<domain>, enable it (ln -s ../sites-available/prismgram /etc/nginx/sites-enabled/),nginx -t && systemctl reload nginx, thencertbot --nginx -d <domain>for HTTPS. The file proxies only PhotoPrism's API (/api/v1/) and the PrismGram API (/api/,/s/), serves/loginand/demo/, and keeps/gram/api/and/gram/s/for older share links. - In
/opt/photogram/photogram.confsetPHOTOGRAM_SHARE_BASE=https://<domain>/sso share links use the new domain, andsystemctl restart photogram-api.
Log in at https://<domain>/login. The public page can carry your own analytics id and a "buy me a coffee" link: copy promo/site.json.example to promo/site.json and fill in analytics, coffee, coffeeLabel (no file = neither). This guide is install/index.html, generated from docs/INSTALL.md with python3 build/install_page.py; the download archive is built with bash build/package.sh.
Instagram (optional)
Instagram needs a Meta developer app and an Instagram professional account (Business or Creator). Once set up, each PhotoPrism user connects their own account from the app (Settings › Instagram › Connect with Instagram); a pasted token and the server script still work too.
- At https://developers.facebook.com create an app (type Business), add the Instagram product and open
API setup with Instagram business login › Business login settings. Fill in, with your own host:
- OAuth redirect URI:
https://<host>/api/instagram/callback(classic/gram/installs:https://<host>/gram/api/instagram/callback) - Deauthorize callback URL:
https://<host>/api/instagram/deauthorize - Data deletion request URL:
https://<host>/api/instagram/data-deletion
- OAuth redirect URI:
- Put the app's id and secret in
/opt/photogram/photogram.conf(root-only file):
thenIG_APP_ID=<Instagram app id> IG_APP_SECRET=<Instagram app secret> IG_REDIRECT_URI=https://<host>/api/instagram/callbacksystemctl restart photogram-api. - While the app is in development mode only accounts with a role on it can connect: your own, plus anyone you add under App roles › Instagram testers (they accept the invite in Instagram › Settings › Website permissions › Tester invites). A public install needs Meta's App Review (Advanced Access).
- In PrismGram: ☰ › Settings › Instagram › Connect with Instagram. The server exchanges the code for a long-lived token,
stores it root-only, renews it nightly and runs the first sync. Permissions asked: profile and posts, insights, comments.
Alternatives: Paste a token on the same page, or
photogram-instagram-token [username]on the server.
Several users on one server
Every PhotoPrism account can log in to PrismGram. The photo library is PhotoPrism's (shared, as in PhotoPrism CE); each user has their own Instagram connection, data, matches, imports, trip names and share links (/var/lib/photogram/users/<uid>/, /var/lib/photogram-private/). Users without an Instagram connection simply don't see the Instagram features.
Push notifications and backups (script install)
Edit /opt/photogram/ops.conf: NTFY_TOPIC (subscribe to it in the ntfy app), REMOTE for off-server copies via rclone (Google Drive, S3, DigitalOcean Spaces). Daily backup 03:30, hourly checks, weekly summary.
Files
| Path | What |
|---|---|
/opt/photogram/photogram.conf | where PhotoPrism lives, owner, share-link base, Instagram app id / secret / redirect URI |
/opt/photogram/ | scripts, caches, owner token instagram.env, other users in accounts/<uid>/ |
/var/lib/photogram/ | data the app reads (owner) and users/<uid>/ (other users) |
/var/lib/photogram-private/ | share links, per-user preferences (never served directly) |
/etc/nginx/snippets/photogram.conf | the nginx routes |