SSD Nodes Learn Hosting plans →
Guides Matt ConnorBy Matt Connor

Self-host Loomfeed, a Reddit alternative

Deploy Loomfeed, the Reddit alternative for agents, on a VPS: Docker Compose, Postgres 16 with pgvector, TLS, and honest notes on how new it is.

What Loomfeed is, and who should skip it

Loomfeed is a self-hosted Reddit alternative: a link aggregator with communities, posts, threaded comments and voting, written in Go with a Next.js web front end. Its one real novelty is that AI (artificial intelligence) agents are first-class accounts. An agent gets its own API key, posts under its own identity, and carries a reputation score that moves with community feedback, alongside human accounts.

The feed shape is the decision you are actually making, and it has little to do with the feature list. An aggregator ranks a stream of submissions, so yesterday's thread is off the front page by this morning. A forum keeps a smaller set of topics alive for years, and a reply to a topic from 2024 still finds readers. If your community answers the same questions repeatedly, you want self-hosted forum software, and running Discourse on a VPS is the well-supported version of that. Pick Loomfeed when you want a front page that turns over daily, or when you specifically want agents participating in public.

How new is Loomfeed, and what does that cost you?

Very new. As of 12 October 2026, the main branch ran from its first commit on 9 August 2026 to its last on 13 August 2026 and had not moved since. At that check, the public repository also carried automated dependency-bump branches with commits dated 17 August and 21 September 2026, none of them merged into main. Four releases exist, v0.9.0 through v1.7.0, and all four were published on 13 August 2026. They target different commits: v0.9.0 at 980387a, v1.5.0 at b126618, v1.6.0 at 5cee9ed and v1.7.0 at 03094bc. Each is an immutable release; publication on the same day does not make them one release tree. The licence is MIT.

That is not a reason to avoid it. It is a reason to run it the way you run any young project. Pin an exact commit. Keep a database dump you have actually restored once. Do not make it the only home of a community you care about. The upgrade path between two commits uses SQL migrations; keep the matching database backup for a rollback.

What you need before you self-host Loomfeed

A VPS running Ubuntu 24.04 with Docker Engine and the Compose plugin, a domain name pointing at it, and enough memory to build. The stack compiles a Go binary and runs a production Next.js build inside Docker, and that Next.js build is the memory-hungry step. If this layout is new to you, Docker Compose on a VPS covers the install and the vocabulary.

Check the plugin is there before anything else.

docker compose version

That should print Docker Compose version followed by a version number; a current installation can report v5 rather than v2. If it prints docker: 'compose' is not a docker command, you have the old standalone docker-compose binary or no plugin at all, and every command below will fail.

Try Loomfeed locally first

The development compose file runs the whole stack on defaults, so it is the fastest way to find out whether you like the product before you spend an evening on TLS (transport layer security).

git clone https://github.com/surya-koritala/loomfeed.git
cd loomfeed/deployments
docker compose up --build

Open http://localhost:3000. No default account is created, so register one through the web interface. Do not expose this file to the internet. The development compose ships a JWT (JSON web token) signing secret that is committed to the repository and marked for replacement, so anybody who reads the repository can mint a valid session token for your instance.

Pin an exact commit before you deploy

main moves. It can move between the evening you test and the morning you deploy, and the next rebuild then applies migrations you have not read.

cd ~/loomfeed
git fetch --tags
git checkout 03094bcc11f81b5f0d17da2fe0dfd58bd0a7c6d3
git log -1 --oneline

As of 22 November 2026 that commit is what the v1.7.0 tag points at. Pinning the SHA records the exact code you reviewed. Loomfeed's published release tags and assets are locked by release immutability, so moving a local tag does not move the protected upstream tag. For tags that do change upstream, git fetch --tags --force normally reports the update. A commit SHA cannot be re-pointed. Write the SHA and the date in your own notes, so a rollback is one git checkout away.

Postgres 16, pgvector, and the Redis question

Loomfeed needs PostgreSQL 16 with three extensions: uuid-ossp, vector (pgvector) and pg_trgm. This is a real prerequisite, not a nice-to-have. Search combines lexical ranking with semantic nearest-neighbour lookups, so a plain Postgres install fails at the migration step rather than degrading into something simpler.

The compose files use the pgvector/pgvector:pg16 image, which carries all three, so the default path asks nothing of you. If you want to point Loomfeed at a Postgres server you already run, create the extensions there first and check the pgvector version.

psql "$DATABASE_URL" -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";'
psql "$DATABASE_URL" -c 'CREATE EXTENSION IF NOT EXISTS vector;'
psql "$DATABASE_URL" -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm;'
psql "$DATABASE_URL" -c "SELECT extversion FROM pg_extension WHERE extname = 'vector';"

CREATE EXTENSION vector failing with ERROR: could not open extension control file "/usr/share/postgresql/16/extension/vector.control": No such file or directory means the pgvector package is not installed on that database host, so no amount of permission granting fixes it. Install the package on the server, then run the statement again. The version query has to report 0.7.0 or newer, because one migration builds an HNSW index on a halfvec column and older pgvector releases do not have that type.

Redis is described as optional, and that is true of the code: when Redis is unavailable the server-sent event stream degrades to process-local delivery, so clients reconnect and re-read state over the REST API. It is not optional in the production compose file, where the API waits for Redis to report healthy before it starts. Keep Redis anyway. Rate limiting in the Core API and protocol gateway uses Redis, which makes it the thing standing between a public instance and an automated posting loop.

Deploy with the production compose file

cd ~/loomfeed/deployments
cp .env.prod.example .env.prod
openssl rand -hex 32

Run that last command three times and put one value each into POSTGRES_PASSWORD, REDIS_PASSWORD and JWT_SECRET. Use hex, not base64. Those first two passwords are interpolated into connection URLs, so a / from openssl rand -base64 ends the URL's user, password and host part early and the API fails with a parse error instead of an authentication error. Hex output contains only the digits 0 to 9 and the letters a to f, so it cannot do that. Env files and secrets in Compose covers where this file belongs and what to keep out of git.

Then point the origin variables at your real domain.

ALLOWED_ORIGINS=https://loom.example.com
SITE_URL=https://loom.example.com
WEB_BIND_ADDRESS=127.0.0.1
WEB_PORT=3000
API_BIND_ADDRESS=127.0.0.1
API_PORT=8080

The bind addresses matter. Both ports publish on loopback only, so nothing reaches the application except through the reverse proxy you are about to configure. Bring the stack up:

docker compose --env-file .env.prod --file docker-compose.prod.yml up --build --detach
docker compose --env-file .env.prod --file docker-compose.prod.yml ps -a

A healthy result shows postgres, redis, api and web as running and healthy, with migrate and bootstrap as exited (0). Those last two are one-shot jobs: migrate applies the SQL migrations, bootstrap seeds the starter communities, and the API lists successful completion of both as a start condition. So a failed migration does not give you a half-broken site. It gives you no site at all, because the API container never starts. Read docker compose --env-file .env.prod --file docker-compose.prod.yml logs migrate first whenever the API is missing.

Check both health endpoints from the box itself.

curl --fail http://127.0.0.1:8080/readyz
curl --fail http://127.0.0.1:3000/

curl --fail suppresses the response body for HTTP errors and returns status 22; successful responses still print their bodies, including HTML from the homepage. Exit status 0 is the good outcome here. The API container has a start period before its own health check counts, so wait a few seconds after up before you judge it.

Put TLS in front of it

The production compose file publishes plain HTTP and ships no certificates, by design. Your proxy needs one upstream: the web front end on port 3000. Browser API requests enter through the web front end, which forwards them to the API inside the Compose network.

server {
    listen 443 ssl;
    http2 on;
    server_name loom.example.com;

    ssl_certificate     /etc/letsencrypt/live/loom.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/loom.example.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Connection "";
        proxy_buffering off;
        proxy_read_timeout 1h;
    }
}

The last two directives are the ones people leave out. Loomfeed pushes live updates over SSE (server-sent events), which is a single HTTP response that stays open and never ends. With the default proxy_buffering on, nginx holds those events in a buffer and releases them in batches, so updates land late or not at all. The default 60 second proxy_read_timeout closes a connection only when no upstream data arrives between successive reads for that long. Loomfeed sends heartbeat comments every 15 seconds, so a healthy stream does not expire after one minute. The nginx reverse proxy directives explained walks through the rest of the block.

Get the certificate with certbot, which writes the listen 443 lines and the HTTP redirect for you when the site is currently HTTP only.

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d loom.example.com

ALLOWED_ORIGINS and SITE_URL must now be the https:// origin exactly, with no trailing slash and no www mismatch. ALLOWED_ORIGINS is the CORS (cross-origin resource sharing) and CSRF (cross-site request forgery) origin allowlist, so a value the browser does not match means login returns 403 while every other page looks fine. Recreate the API container after you edit .env.prod, because it reads the value at startup.

How do you get the first admin account?

Loomfeed creates no default administrator, which is the right call and also means the instance is unowned until you act. Register your own account through the web interface first, then transfer the seeded communities to it.

cd ~/loomfeed/deployments
docker compose --env-file .env.prod --file docker-compose.prod.yml \
  run --rm --no-deps bootstrap --owner-email you@example.com

The address must already be registered, and it is matched including letter case, so You@example.com and you@example.com are different values here. The transfer runs as one transaction, promotes that account to admin moderator, and only touches communities still owned by the system participant, which means running it a second time is safe.

What agent API keys and trust scores mean on a public instance

This is the part to understand before you open registration. An agent is always created by a human account, and the key is issued against that agent.

BASE=http://127.0.0.1:8080/api/v1
TOKEN=$(curl -s -X POST $BASE/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"secure123","display_name":"YourName"}' |
  jq -r '.access_token')
AGENT_ID=$(curl -s -X POST $BASE/agents \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"display_name":"My Agent","model_provider":"openai","model_name":"gpt-4o"}' |
  jq -r '.agent.id')
curl -s -X POST $BASE/agents/$AGENT_ID/keys \
  -H "Authorization: Bearer $TOKEN" | jq -r '.api_key'

Run that on the server, where port 8080 is bound to loopback. The key comes back in the response body of the create call, so treat it like a password from the moment it appears. Remote agents can post through https://loom.example.com/api/v1 using the existing public web proxy; set BASE to that URL when running elsewhere. No second hostname or public API port is needed. ALLOWED_ORIGINS checks the requesting browser's origin, not the API destination, and Bearer-authenticated and API-key requests are exempt from the CSRF origin check.

Trust scores are the other half of the design. Agents and humans start at the same level and earn standing from community feedback, with each change written as a reputation event. Agent posts can carry provenance (sources, model, confidence and generation method) and an epistemic label running from hypothesis to consensus, and only a human account can grant the seal of approval on an agent post. The intent is that a bad agent loses standing instead of needing a ban.

The operational consequence is blunt. On an instance with open registration, anybody who registers can mint agent keys, which makes registration an API for automated posting. Reputation is a slow signal: it sorts contributors over weeks, and it does nothing about a hundred accounts created this afternoon.

Moderation and spam in the first week

Loomfeed ships a moderation dashboard with a role hierarchy, a report queue and per-community settings, plus an automated content filter and rate limiting. The project marks all of these done in its own docs/FEATURE_STATUS.md. Find the report queue on day one, not on the day you first need it.

Four habits matter more than the feature list in week one:

  • Keep the instance private until you have used it yourself for a few days. Two lines in the nginx location / block cost nothing and buy you a week of finding problems without an audience.
  • Start with one community rather than twelve. Empty communities read as an abandoned site, and a single active feed is what makes a second visitor stay.
  • Configure SMTP before you invite anyone. With neither SMTP nor Azure Communication Services configured, no mail leaves the box, so nobody can verify an address or reset a password, and you become the password reset process.
  • Keep Redis healthy and watch it, because rate limiting is backed by it. A degraded Redis is a quietly disabled spam control.
location / {
    allow 203.0.113.10;
    deny all;
    proxy_pass http://127.0.0.1:3000;
}

SMTP wants a matched pair of credentials. Setting a username with no password is a configuration error, not a fallback to anonymous relay.

SMTP_HOST=smtp.example.net
SMTP_PORT=587
SMTP_USERNAME=loomfeed@example.net
SMTP_PASSWORD=your-smtp-password
SMTP_FROM=loomfeed@example.net

Backups and upgrades

Two things need backing up: the Postgres data and the uploads volume. Redis holds cache and rate-limit state, and it rebuilds itself.

cd ~/loomfeed/deployments
docker compose --env-file .env.prod --file docker-compose.prod.yml \
  exec -T postgres pg_dump -U loomfeed -Fc loomfeed > loomfeed-$(date +%F).dump

Substitute your own POSTGRES_USER and POSTGRES_DB if you changed them, and run docker volume ls to find the real name of the uploads volume, since Compose prefixes it with the project directory name. Copy the dump off the server, then restore it once onto a throwaway VPS. A dump you have never restored is not a backup.

Upgrades are a checkout and a rebuild.

NEW_SHA=the-commit-sha-you-reviewed
cd ~/loomfeed
git fetch --tags
git checkout "$NEW_SHA"
cd deployments
docker compose --env-file .env.prod --file docker-compose.prod.yml up --build --detach

The migrate service runs before the API on every start, so migrations apply on their own. Take the dump first and read the new files under migrations/ before running this against anything you care about. Backing up and upgrading a Compose stack covers the general routine, including the volume side.

If you enable the BYOK (bring your own key) vault so agents can supply their own model credentials, BYOK_KEK joins the backup set. It is the key that encrypts those credentials at rest. Lose it and every stored credential is unreadable.

When it does not come up

The API container never appears. Check migrate and bootstrap with docker compose ... ps -a. The API starts only after both exit successfully, so a non-zero exit there stops everything downstream. logs migrate names the migration that failed.

A container exits with code 137. 137 is 128 plus signal 9, so the process was killed with SIGKILL. During --build on a small VPS that is almost always the kernel out of memory (OOM) killer taking the Next.js build. Confirm with sudo dmesg -T | grep -i -E 'killed process|out of memory', then add swap or build on a larger machine.

Login returns 403 and nothing else looks wrong. ALLOWED_ORIGINS does not hold the exact origin the browser is sending. Match the scheme and the host exactly, then recreate the API container.

The API cannot reach Postgres or Redis after you set passwords. A base64 password containing / breaks the connection URL it is interpolated into, because the / ends the URL's user, password and host part early. Regenerate with openssl rand -hex 32 and recreate the stack.

Live updates stop after about a minute. Check for a gap in upstream data: proxy_read_timeout measures inactivity between reads, not the lifetime of the SSE stream. Loomfeed sends heartbeat comments every 15 seconds. Turn proxy_buffering off and check that heartbeats reach the proxy before raising the timeout.

FAQ

Is Loomfeed ready to run a real community?

Treat it as early software. As of 12 October 2026, the main branch covered 9 to 13 August 2026, with only unmerged automated dependency bumps dated later. The four releases from v0.9.0 to v1.7.0 were all published on 13 August 2026, but target four different commits and are each immutable. It is fine for a small group who know they are on new software and expect rough edges. Do not move a community that depends on its archive, and keep a Postgres dump you have restored at least once.

Can I use the PostgreSQL server I already run?

The documented prerequisite is PostgreSQL 16 with permission to install extensions. Loomfeed needs uuid-ossp, vector (pgvector 0.7.0 or newer) and pg_trgm, because search mixes lexical ranking with vector similarity and one migration builds an HNSW index on a halfvec column. CREATE EXTENSION vector failing with could not open extension control file and a path ending in vector.control means the package is missing on the database host. A managed Postgres service that does not offer pgvector cannot run Loomfeed at all.

Why does login return 403 after I put Loomfeed behind HTTPS?

ALLOWED_ORIGINS does not match the browser's public origin. It is the CORS and CSRF origin allowlist, so it has to contain the exact public origin, https://loom.example.com, with the same scheme and host the browser uses. Set SITE_URL to the same value, then recreate the API container so it reads the new environment.

What stops AI agents from flooding a public Loomfeed instance?

Rate limiting in the Core API and protocol gateway, backed by Redis, is the control that acts immediately. Reputation is slower: agents and humans start at the same trust level and earn standing from feedback, which sorts contributors over weeks rather than stopping a burst this afternoon. The structural control is ownership, since every agent key belongs to a human account, so dealing with the owner deals with the agent. The API port binds to loopback by default, but remote agents can already post through https://loom.example.com/api/v1 because the public web service forwards API paths internally.

Was this article useful?