# Lemmy-Postgres

Lemmy-Postgres is a self-hosted databases app. PostgreSQL database for Lemmy with automatic database upgrades. It is open source and self-hosted, installable on Docker Hub, TrueNAS and Unraid.

Canonical page: https://ourlocalhost.com/app/84/lemmy-postgres

## Description

PostgreSQL database for Lemmy with automatic database upgrades. It stores Lemmy data and helps self-hosted operators upgrade PostgreSQL with less manual work.

## Platform availability

Available on 2 of 9 platforms: Unraid, TrueNAS.

## Health score

65/100 (Good), based on 5 of 5 factors.
- Maintained: 100 (last commit 22 days ago)
- Popular: 83 (14,614 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)
- Light to run: 40 (4 GB minimum RAM, runs on ARM)
- Security check: 20 (1 serious finding, 3 minor, tests, OpenSSF Scorecard 5.3/10)

## Security check

1 serious finding: Uses lettre 0.11.19, which has a known critical vulnerability.
Automated checks on commit fc640cf, 14 Oct 2026. Not an audit.

## Links

- Docker Hub: https://hub.docker.com/r/pgautoupgrade/pgautoupgrade/
- GitHub: https://github.com/LemmyNet/lemmy
- TrueNAS: https://apps.truenas.com/catalog/postgres/
- Unraid: https://ca.unraid.net/apps/lemmy-postgres-052m6k51stcak9?q=Lemmy-Postgres
- Official website: https://www.postgresql.org/

## Common questions

### Why does Lemmy fail to start or save posts if PostgreSQL is not working?

Start PostgreSQL first; if the service errors, create the data folder, make it owned by the postgres user, and initialize it. Without a running database, Lemmy cannot save posts, comments, or accounts and will not start.

### What environment file needs to be prepared before the first Lemmy run?

Copy the example environment file to .env.local and fill in site settings before starting Lemmy. Missing or wrong settings can cause errors, make Lemmy use the wrong database, or prevent the site from being reachable by your domain.

### What host setting can break HTTPS or the Lemmy web front end?

Replace the placeholder example.com in the lemmy-ui service file with your actual domain and save it under /etc/systemd/system. Leaving the wrong host can prevent the web front end from connecting to your server or make HTTPS not work properly.

### Why might a remote Lemmy instance appear lagging in federation state?

Remote Lemmy instances send apub sync actions serially through the Lemmy queue. If your server processes them slower than the origin server sends them, the remote instance will show as lagging.

## Alternatives

- Aether: Open source, self-governing communities with auditable moderation and mod elections.
- Digg: Social news platform with topic-based communities, transparent moderation, user voting, content discovery, anti-spam measures, web and mobi…
- Hacker News: Hacker News is a social news website that caters to programmers and entrepreneurs, delivering content related to computer science and entre…
- Reddit: A social news website where content shared by users is voted on, organized into 'subreddits,' and can appear on the front page amid diverse…
- Steemit: A non-censored social platform where users are incentivized to contribute and curate content.
- Tildes: A non-profit community site driven by its users' interests.
- Voyager: Voyager is a self-hostable, open-source web client for Lemmy, a federated link aggregator.

---
Source: Our Local Host (https://ourlocalhost.com/app/84/lemmy-postgres), the self-hosted and open-source app directory.
