Deploy Foldergram
Turn folders of photos and videos into a private Instagram-style gallery
foldergram
Just deployed
/app/data
Deploy and Host self hosted Foldergram (Photo Gallery) on Railway
Foldergram turns folders of photos and videos into a private, Instagram-style gallery you run yourself.
About Hosting Foldergram open-source software on Railway (self hosted Foldergram template)
This template runs the unmodified upstream Foldergram 1.3.1 image (AGPL-3.0) as one Railway service with one volume at /app/data. It is independent community packaging, not affiliated with or endorsed by the Foldergram project. The upstream app port is 4141, which the template maps to Railway PORT 8080.
Why Deploy Foldergram, the self-hosted folder-based photo and video gallery on Railway (Railway Free Trial)
Deploying Foldergram on Railway gives you a private, Instagram-style view of your folders, with no subscription and no third party holding your originals.
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Foldergram on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Railway vs Other Hosting Providers and VPS for Foldergram self hosting
Railway compared with common alternatives:
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | A template deploy with one service, one volume at /app/data, and a public HTTPS domain. | A VM you control; you handle Docker, firewall, updates, and backups. |
| AWS | One service and volume set up by the template, with usage-based billing and no networking to configure. | Many composable cloud services, which add flexibility but also setup and ongoing work. |
| Hetzner | A container, health check, and volume already defined so you can start adding media. | Low-cost servers; you handle OS hardening, Docker, proxy, and TLS. |
Choose Railway for the fastest route to a running instance, and a VPS when you need full host control.
Common Use Cases for hosted Foldergram
- A private feed over your folders: Browse trips, family albums, or event folders in an Instagram-style feed with Recent, Rediscover, and Random modes.
- Folders as profiles: Each folder that directly contains media becomes a profile with a posts grid. Folders with videos also get a Reels tab.
- Carousel posts: Put related images or clips in a carousels folder and Foldergram groups them into one swipeable post.
- Sharing with others: Set a separate viewer password so relatives can browse and like posts without access to Settings, or switch to public browse mode for a read-only gallery.
- Fast browsing: The container includes ffmpeg, so video posters and previews are generated while originals stay untouched.
Dependencies for Foldergram Docker hosted on Railway
This template runs one Foldergram container with one persistent volume. Foldergram uses a local SQLite file, so keep one replica.
Deployment Dependencies for Managed Foldergram Service (one container with one volume)
The template deploys one service named foldergram. It listens on port 8080 and attaches one volume at /app/data. The service exposes a health check at /api/health.
Implementation Details for Foldergram (unmodified Foldergram 1.3.1 image plus a Railway start script)
The image ghcr.io/onepush-dev/foldergram:1.3.1-r1 runs the unmodified upstream 1.3.1 image with a small start script added. IMAGE_DETAIL_SOURCE=preview and DERIVATIVE_MODE=eager are baked into the image. Two variables, zero inputs: FOLDERGRAM_ADMIN_PASSWORD (generated, applied on first start) and CSRF_TRUSTED_ORIGINS (the Railway https origin).
How does Foldergram compare against other tools
Foldergram vs Immich (Immich Alternative)
- Library model: Foldergram reads your existing folders, with each folder as one profile and nothing re-imported.
- Uploads: Foldergram has no upload feature, so you copy media onto the volume yourself. Immich wins if you want phone uploads.
- Accounts: Foldergram offers an admin password plus an optional viewer password, with no multi-user accounts. Immich supports multiple users.
Foldergram vs PhotoPrism (PhotoPrism Alternative)
- Browsing style: Foldergram gives an Instagram-style feed over directories; PhotoPrism is oriented toward a searchable library.
- Search and recognition: PhotoPrism offers richer search and labeling; Foldergram focuses on browsing folders.
- Scope: Foldergram has no cloud sync or remote APIs, which keeps it simple but limits integrations.
Foldergram vs Google Photos (Google Photos Alternative)
- Hosting: Google Photos is a hosted service you do not run yourself. Foldergram runs on your own infrastructure, so your files stay under your control.
- Convenience: Google Photos wins on automatic phone backup, sharing, and search.
- Privacy: Foldergram keeps originals in your gallery folder and does not sync them anywhere, which suits a private archive.
Foldergram with Docker Compose vs Railway (Foldergram Docker Compose Alternative)
- Setup: Compose on a VPS means managing folders, volumes, and HTTPS yourself; Railway deploys one service from a template.
- Control: Compose gives direct filesystem access. Railway cannot mount a folder from your computer, so the gallery starts empty and you copy media onto the volume.
- Persistence: Railway keeps gallery, database, thumbnails, and previews on one volume.
How to use Foldergram on Railway?
- The gallery starts empty. Railway cannot mount a folder from your computer, and Foldergram has no upload feature, so copy media onto the volume yourself.
- Sign in with the generated
FOLDERGRAM_ADMIN_PASSWORDfrom the Variables tab. Access defaults to admin-only, so you will need it to browse. - Copy your media onto the volume with the Railway CLI, for example
railway volume files upload ./my-album /gallery/my-album. Volume paths are relative to the volume root, which is mounted at/app/data, so the gallery folder is/galleryon the volume. - Each folder that directly contains media becomes one app folder. Files in the gallery root are ignored, so use subfolders.
- Open Settings, then Scan and Library, then Scan for changes to index the new files.
- To confirm the service is healthy, check the health endpoint:
curl https://your-domain/api/health
How to self host Foldergram on other VPS Services (Foldergram self hosting guide)
Any VPS with Docker can run Foldergram as a single container.
Clone the Repository
Cloning the source is unnecessary. Download the upstream Compose file:
mkdir foldergram
cd foldergram
wget -O docker-compose.yml https://raw.githubusercontent.com/foldergram/foldergram/main/docker-compose.yml
Pin the image to the 1.3.1 tag in that file.
Install Dependencies
Install Docker and the Compose plugin. The container includes ffmpeg.
Configure Environment Variables
Create a gallery folder and copy a few photos or videos into it:
mkdir -p data/gallery/example-album
Set CSRF_TRUSTED_ORIGINS to your public origin, such as https://your-domain, when it differs from localhost. Put HTTPS in front of the app with a reverse proxy.
Start the Foldergram Application
Start the container, then open http://localhost:4141:
docker compose up -d
Set the admin password in Settings after the first start. Railway handles hosting, HTTPS and the volume for you, so this manual setup is only needed on your own VPS.
Pricing and License of Foldergram (Foldergram pricing)
Foldergram is open-source software under AGPL-3.0, so you can self-host and modify it under that license. The template adds no separate fee.
Foldergram hosted vs self hosted comparison (Pricing, features, costs, and more)
Foldergram is free AGPL-3.0 software you can self-host anywhere. Upstream runs a public read-only demo site but offers no hosted plan.
Monthly cost of self hosting Foldergram on Railway
Railway bills by usage, so the monthly cost depends on RAM and CPU use, volume size, and how many other services share your project.
System Requirements for Hosting Foldergram on a VPS
A small VPS handles a personal library; video thumbnailing and previews are the heaviest work and benefit from more CPU and RAM.
Frequently Asked Questions (FAQs)
Why is my gallery empty?
Nothing is bundled with the template, and Railway cannot mount a folder from your computer. Upload folders with railway volume files upload or railway volume browse into /gallery on the volume, then run Settings, then Scan and Library, then Scan for changes.
Which file formats work?
Images can be jpg, jpeg, png, webp, gif, or avif, and videos can be mp4, mov, m4v, webm, or mkv. The image includes ffmpeg, so video thumbnails and previews can be generated.
How do I share with family?
In Settings, add a separate viewer password for read-only access with shared likes, or switch to public browse mode where anyone can browse and you unlock admin with the admin password.
Can I change the admin password?
Yes, change it in Settings at any time. The FOLDERGRAM_ADMIN_PASSWORD variable only applies on first start, so later edits to that variable have no effect.
What should I back up?
Back up the whole /app/data volume, which holds the gallery, SQLite database, thumbnails, and previews. Stop the app first for a consistent SQLite copy, and keep the WAL sidecar files (gallery.sqlite-wal and gallery.sqlite-shm) with the database.
Is it multi-user with uploads?
No. Upstream Foldergram has no multi-user accounts, uploads, comments or cloud sync; it is a role-based password gate (admin, viewer, public browse) over folders you copy onto the volume.
Template Content
foldergram
ghcr.io/onepush-dev/foldergram:1.3.1-r1