Skip to content
adlererikPublic

About

Libregram: a free, open-source Instagram alternative without a walled garden or media lock-in. Self-host your photos and videos, share compilations with one URL, and play them via AirPlay or Google Cast.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

41 Commits

Folders and files

Repository files navigation

Libregram

A free Instagram alternative. Your media, without the walled garden.

By Erik Adler · Latest release v1.6.0 · MIT license

Libregram is a free, open-source Instagram alternative focused on sharing your photos and videos without media lock-in. Run it on your own server, keep your originals, and move your collection whenever you want. An Instagram-style timeline, a cinematic gallery, and a built-in CMS make it easy to publish and enjoy your memories.

Share a compilation of photos and videos with one short URL, send an individual memory by email or message, or play your media on a TV with AirPlay or Google Cast. Friends and family can open shared links without creating an account or installing an app.

New installations use a normal CMS username and password. No Cloudflare account, fingerprint reader, or social login is needed to install, clone, or sign in. Optional Cloudflare sign-in is an owner's later choice.

Why Libregram exists

By Erik Adler:

I wanted Instagram-style sharing without the walled garden: a home for my memories that I could own and run myself. I built Libregram to preserve original photos and videos, present them beautifully, and share a whole story with one link or on a TV. Your media should stay yours, with no platform lock-in.

For this personal sharing workflow, the advantages are concrete:

  • Own the collection: keep original files and a portable SQLite database on your server, with private backups you control.
  • Share a whole story: mix photos and videos, arrange Favorites, and send one link that plays the collection in order and can repeat.
  • Make viewing easy for family: recipients open a link without an account or an app; thumbnail previews appear in messaging apps that support them.
  • Bring memories to the big screen: send selected media or a presentation to compatible Google Cast and AirPlay receivers.
  • Find the past quickly: use a continuous timeline, a compact wall of every carousel item, and year jumps.
  • Curate beyond an upload feed: backdate posts, reorder carousel items, add soundtracks, and choose a gallery theme.
  • Keep administration together: a discreet login icon and a settings cogwheel give you media tools, visitor history, and the handbook.

Libregram focuses on personal media sharing and a built-in CMS. It provides no follower feeds, direct messaging, or federated social network. The software is free; you supply the server, storage, Internet connection, and any domain or receiver hardware.

Project screenshots

The project's existing screenshots are preserved below. They illustrate the gallery; a fresh installation starts empty with your own media.

24921 Mobile device 24920 Mobile device 24916 Casting from mobile device. Screenshot From 2026-10-10 23-37-56 Desktop Screenshot From 2026-10-10 23-38-24 Desktop Screenshot From 2026-10-10 23-41-55 Desktop Screenshot From 2026-10-10 23-39-40 Desktop Screenshot From 2026-10-10 23-41-02 Desktop Screenshot From 2026-10-10 23-40-17 Desktop

Start here

New to servers? Follow the beginner guide. It explains the terminal commands, first login, first upload, sharing, TV playback, public HTTPS, startup at boot, backups, and recovery.

What makes Libregram useful

Feature What you can do
One link for a compilation Select photos and videos, arrange them in Favorites, and share a continuous presentation using one compact URL.
Direct media links Send a particular photo or video with Copy link, Email, Message, or the device's share sheet where available.
Easy viewing for recipients No account needed; presentations advance through timed photos and full videos, with repeat, pause, seeking, speed, and fullscreen where supported.
Link previews Open Graph thumbnail metadata gives compatible messaging apps a preview of the first item.
Google Cast and AirPlay Send selected media to a compatible TV from supported Chrome or Apple Safari. The page and admin controls stay off the TV.
Favorites presentations Save individual carousel items, reorder them, choose photo duration, and play locally or on a TV.
Continuous timeline Browse newest first, scroll seamlessly into older memories, expand long captions with a centered chevron, and see ages based on your configured birthday.
Fast thumbnail wall Browse every photo/video in a compact grid, jump to a year, open an exact item, and return to your scroll position.
Carousel navigation Swipe, tap the item counter, or choose a thumbnail; edit ordering and add or remove items later.
Desktop and mobile viewers Cinematic desktop theater, inline mobile media, native video controls, and keyboard navigation.
Discreet controls A small top-right icon column fades after inactivity; matching translucent buttons leave more of the picture visible.
Controlled sound Sound is requested by default, deliberate mute is respected, and one active wall video prevents overlapping audio.
Five themes Gold, Graphite, light Porcelain, Midnight, and Verdant; your media keeps its original colors.
Post soundtracks Upload audio, preview, trim, adjust volume, loop, and choose whether to keep original video sound.
Built-in CMS Drag/drop uploads, multi-file carousels, backdated memories, caption/date editing, and insertion anywhere in the timeline.
Visitor history Outside visits with IPv4/IPv6, country flag, estimated city, OS/device/browser, and counts; recognized owner/local visits are excluded.
Free location API and maps Optional IP2Location.io city estimates with caching and a local fallback; open estimated coordinates in Apple Maps or Google Maps.
Estimated visit duration See time while the page was visible, updated about every 20 seconds; older durations are not invented.
Visitor region filters Combine Western Europe, Scandinavia, North America, South America, and Asia, or choose World; filter counts/history without blocking traffic or deleting records.
Your own page title The browser tab uses the Title saved in Header text settings.
Age tracking settings Enter a person's birthday, preview their age today, and toggle age labels on memories; save without rebuilding or restarting.
Optional PIN shortcut Enable a handset, set a destination URL and a 4–12 digit PIN. Every tap opens a fresh themed keypad; the separate phone app keeps its own security. Off by default.
Ready-to-run Docker image Start with Compose on AMD64 or ARM64, with generated credentials, persistent media/settings, recovery commands, and safe schema initialization.
Persistent statistics History stays until you manually delete one visit or all history; older records are paginated.
Simple default login A unique username/password installation with local recovery; optional verified Cloudflare identity login for owners who configure it.
Settings and handbook The cogwheel contains header text, visitor history, login settings, and included documentation; the square-plus keeps uploads separate.
Hearts Like an entire post separately from saving an individual photo/video to Favorites.
Instagram export import Import your own downloaded export, preserving dates and carousel order and repairing common caption encoding issues.
Local preservation Keep originals, previews, compatible playback files, and SQLite data on your server.
Your own domain and server Debian/Ubuntu setup, boot services, optional Cloudflare HTTPS tunnels, and backup/migration instructions.

See features and practical limits.

Quick start with Docker

Install Docker with Compose. In an empty folder, download compose.yaml from the release, then:

docker compose up -d
docker compose exec libregram node deploy/docker/manage.mjs credentials

Open http://localhost:3000. The second command privately displays your unique generated login; normal container logs do not print the password. No environment file, Node installation, Cloudflare account, or API key is needed. A new volume starts empty with ordinary CMS password login, no preset birthday, and the phone icon off. Read the Docker guide for installation, LAN/HTTPS access, upgrades, backups, and password recovery. The default port is local to that computer; enabling public access is a separate setup step.

The public image is ghcr.io/adlererik/libregram:1.6.0. Keep the data volume: it holds your uploads, database, settings, credentials and shared links. docker compose down keeps it; docker compose down -v deletes it. Existing README screenshots stay here as documentation; the image contains no personal gallery or installation data.

Install directly from source

Supported walkthrough: Debian/Ubuntu Linux, a normal user with sudo, Node.js 24+, pnpm 12.10.1, FFmpeg / FFprobe, Git, and Bash. The beginner guide supplies prerequisite commands; do not run application setup as root.

Once those tools are installed:

git clone --branch v1.6.0 https://github.com/adlererik/libregram.git
cd libregram
./libregram setup
./libregram start

Open http://localhost:3000 on that computer, or the server's printed LAN address from another device. Setup installs locked dependencies, creates an empty database, generates a unique password and session secret, explicitly selects password login, and builds the app. Username: admin. Read your generated password privately from .env.local, then use the top-right lock or /admin/login. Store the login in your password manager.

After signing in, square-plus → A new chapter uploads media. Cogwheel → Login settings changes your login; Header text personalizes the gallery. The unlocked icon at the top right signs you out. The beginner guide covers every step and recovery if you lose your password.

Release ZIP/tarball downloads contain audited source, guides, schema, and the dependency lockfile. Setup installs dependencies. Compare downloaded assets with the supplied SHA256SUMS.

Send a compilation to family

  1. Tap the star on each photo/video you want, including individual carousel items.
  2. Open Favorites using the film-reel icon and its selected-item count.
  3. Arrange the order, choose how long photos display, and choose Repeat.
  4. Tap the paper-plane Send to icon; copy the link or open an email, message, or native share sheet.
  5. The recipient opens that one link to watch the selection in order, without signing in.

A link looks like https://your-domain.example/s/AbCdEf0123456789. It keeps the original selection/order even if you later change your browser Favorites. Deleting source media makes that media unavailable in shared views. Your server must remain online, and a stable domain keeps links working. Browsers can require one Play or Tap for sound interaction; automatic sound cannot be guaranteed.

Run and maintain it

./libregram status
./libregram stop
./libregram build
./libregram start
./libregram restart

Run these inside the project folder. A foreground server needs its terminal to remain open. The default listener is 0.0.0.0:3000; a busy port gives an error. For reliable startup after reboot, follow the boot service guide. Back up SQLite, uploads, private environment files, and private runtime settings/shared links as described in Operations.

Import an Instagram export

Extract your own export locally, then run:

INSTAGRAM_EXPORT_DIR="/path/to/your/extracted-export" pnpm import:instagram

The importer reads JSON from disk, preserves timestamps/carousels, fixes common caption encoding, and copies your media into public/uploads/. Previously imported source IDs prevent duplicates. You do not need to provide Instagram login credentials. Import media you are entitled to publish.

Docker users can mount an export read-only and run the container import command; no host Node installation is needed.

TV playback and sound

Google Cast requires a supported Chrome browser and compatible receiver; native AirPlay requires Safari and an AirPlay-compatible receiver. A Chromecast-only TV does not automatically support AirPlay. Use receiver-reachable HTTPS media and allow discovery on your network. The Cast icon is hidden when the browser lacks the required API.

Google Cast presentation queues run on the receiver. AirPlay presentation advancement depends on the sender page remaining active. FFmpeg prepares photo slides and compatible video/soundtrack files locally. Browsers may require a tap for audible playback; native player controls and a speaker toggle remain available. Favorites/themes are stored per browser and site address.

Privacy, costs, and ownership

Source downloads contain no private passwords, tokens, account configuration, personal media files, populated databases, visitor records, private backups, runtime binaries, or compiled builds. Docker images contain the public compiled application and its dependencies; private installation data is generated in your volume after first startup. Each installation supplies its own collection and receives its own credentials. The intentionally published README screenshot links remain.

The published gallery, media, and shared links are public. Admin and visitor IPs require authentication. Visitor history is local, has no automatic deletion, and excludes local/recognized owner traffic. Customize the included visitor privacy notice for your deployment. The default local lookup sends no IPs to a lookup provider. You can enable the free IP2Location.io API for IPv4/IPv6 city estimates, flags, and map links. When enabled, outside public IPs are sent to the provider; its attribution appears on the gallery, privacy notice, and admin statistics. Map pins are approximate, never someone’s exact GPS position. Duration measures visible-page time, not verified attention.

IP2Location.io currently allows 1,000 keyless requests/day or 50,000/month with a free-account key; this implementation caps requests at 900 per UTC day, caches successful estimates for 24 hours, and falls back locally. No card or account is needed for keyless lookup, and there are no free-plan overage charges. Map links require no Maps API key or paid geocoding service. Current provider pricing.

The software is MIT licensed and requires no paid sharing API, link shortener, casting registration, or CMS subscription. Hosting, storage, electricity, Internet service, domain registration/renewal, and receiver hardware are your own costs. Optional Cloudflare services have their own plan limits; the standard password login works without them. See optional identity setup and current plan references.

Built with Next.js, TypeScript, Tailwind CSS, Framer Motion, Lucide, Prisma, and SQLite. See security, release notes, and changelog. Instagram is a trademark of its owner; this independent project is not affiliated with Instagram or Meta.

About

Libregram: a free, open-source Instagram alternative without a walled garden or media lock-in. Self-host your photos and videos, share compilations with one URL, and play them via AirPlay or Google Cast.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages