Forem

Open source Ruby on Rails platform for building developer communities with articles, discussions, and social profiles—the same software that powers dev.to.

22.6Kstars
4.2Kforks
GNU Affero General Public License v3.0
Ruby

Forem is the open source software that powers dev.to, one of the largest developer communities on the web. It provides everything needed to run a fully-featured, blogging-forward social network where members publish technical articles, comment on posts, react to content, and build professional profiles with badges and achievements. Originally created by the DEV team, Forem is now available for anyone to self-host and build their own focused community around any topic.

The platform is built on Ruby on Rails 7 with a Preact-based frontend, PostgreSQL for relational storage, Redis for caching and sessions, and Sidekiq for background job processing. Recent additions include pgvector-backed semantic embeddings for AI-powered feed recommendations using the Google Gemini API, making content discovery smarter without requiring any user configuration. Deployment is supported through Kamal 2 for bare-metal and cloud providers, Gitpod, and Ona for cloud development environments.

Forem’s architecture distinguishes itself through a rich Liquid tag system that lets authors embed rich content from dozens of services—CodePen, GitHub Gists, YouTube, Asciinema, and more—directly in Markdown articles without writing HTML. A comprehensive suite of AI services handles comment quality scoring, article enhancement, content moderation labeling, and personalized digest summaries, all audited and logged for transparency. The platform also supports multi-subforum architectures, allowing a single Forem deployment to host multiple distinct community spaces under one Rails application.

What You Get

  • Markdown article publishing with Liquid tags - Authors write posts in Markdown enriched with 40+ Liquid tags that embed CodePen, GitHub Gists, YouTube, Asciinema, Spotify, Bluesky posts, and more directly in articles without HTML.
  • AI-powered semantic feed - pgvector HNSW indexes on user activity and article embeddings (generated via Google Gemini) power personalized content recommendations that improve without any manual curation.
  • Commenting, reactions, and bookmarks - Readers can leave threaded comments, react with emoji, save articles to a reading list, and subscribe to comment threads for ongoing discussion alerts.
  • Tag-based content taxonomy - Articles carry up to four tags that drive topic feeds, trending surfaces, and tag-following, letting users curate their own reading experience around specific technologies or subjects.
  • Multi-subforum support - A single Forem deployment can host multiple distinct community spaces, each with its own identity, moderation policies, and onboarding flow, all sharing one Rails application and database.
  • AI moderation and content tools - Built-in Gemini-backed services handle comment quality assessment, article enhancement suggestions, spam labeling, profile moderation scoring, and personalized email digest summaries.
  • Comprehensive admin dashboard - A full Blazer-powered analytics suite, Flipper feature flags UI, A/B testing via FieldTest, and Sidekiq dashboards give operators full visibility and control over their instance.
  • Kamal 2 deployment - First-class deployment configuration for bare-metal servers and cloud providers (AWS, DigitalOcean, Hetzner, GCP) with rolling updates, secrets management, and Docker-based delivery.

Common Use Cases

  • Developer-focused community network - A software company self-hosts Forem to run a public-facing developer community where engineers publish tutorials, engage in Q&A, and build reputations through badges and reactions, replacing fragmented Discord threads with a permanent, searchable knowledge base.
  • Niche technical publisher - A group of systems programmers or language enthusiasts creates a Forem instance for their ecosystem—Rust, Elixir, or embedded C—providing a branded home for long-form writing that RSS aggregators and search engines can index, unlike Slack or Discord.
  • Internal engineering blog network - An engineering organization deploys Forem privately to let teams publish post-mortems, architecture decision records, and project retrospectives, with reactions and comments replacing email threads and making institutional knowledge discoverable.
  • Open-source project community hub - An open-source project replaces GitHub Discussions and a static Jekyll blog with Forem to unify contributor announcements, tutorial publishing, and community discussion under one authenticated, profile-driven platform with newsletter digest support.

Under The Hood

Architecture Forem follows a layered Rails MVC structure with explicit separation between domain logic and HTTP concerns. Controllers delegate immediately to service objects in a dedicated services layer, with form objects handling multi-step input validation and query objects isolating complex ActiveRecord composition from models. Pundit policies enforce authorization at the object level, ensuring every action is explicitly permitted rather than relying on implicit access rules. The frontend uses Preact as a lightweight React-compatible layer, with components hydrated from server-rendered HTML to preserve fast initial page loads and full SSR SEO benefits. Background work flows through Sidekiq with throttling, deduplication, and cron scheduling, while Flipper feature flags allow gradual rollout of capabilities without code branches reaching production.

Tech Stack Forem runs on Ruby on Rails 7.2 with PostgreSQL as the primary datastore, extended with the pgvector extension (0.8.0+) for HNSW-indexed semantic search over article and user embeddings. Redis backs ActionPack sessions, Sidekiq queues, and cache stores. The JavaScript layer uses Preact (aliased as React via esbuild module mapping) with a custom crayons component system and Storybook for component development. Search is powered by Algolia with algoliasearch-rails, while Cloudinary and CarrierWave handle image uploading and transformation. Kamal 2 handles zero-downtime deployments with Docker, and Fastly provides CDN and cache busting. The AI layer communicates with Google Gemini via HTTParty, with every API call audited in an AiAudit table for compliance and debugging.

Code Quality The test suite is comprehensive, covering models, services, controllers, policies, liquid tags, workers, and API endpoints through RSpec, with Cypress handling end-to-end flows and Jest with jest-axe covering frontend components and accessibility. Coverage is enforced by CodeCov with thresholds set on the frontend Jest suite. CI runs on GitHub Actions with Knapsack Pro for parallel RSpec distribution, and CodeQL for security analysis. The codebase relies heavily on YARD-style inline documentation on complex methods, and the AI service modules include full audit logging that captures prompt and response tokens, latency, status codes, and error messages for every Gemini call, making the AI layer more observable than typical open-source implementations.

What Makes It Unique Forem’s most distinctive technical contribution is its Liquid tag extension system: over 40 service-specific tags let authors embed rich interactive content in Markdown without writing raw HTML, with each tag implemented as an isolated Ruby class that sanitizes input and renders a safe iframe or native element. The AI integration goes beyond a chatbot add-on—semantic article embeddings are stored as pgvector vectors alongside the article, user activity embeddings track reading interests over time, and the feed query uses HNSW cosine similarity to match readers to relevant content at query time. The subforem architecture allows multi-tenancy within a single Rails app, with per-subforem onboarding flows, feature flags, and branding, making it possible to operate a network of communities from one deployment rather than running separate instances.

Self-Hosting

Forem is released under the GNU Affero General Public License v3.0 (AGPL-3.0). In plain terms, AGPL-3.0 allows you to run the software commercially, modify it, and redistribute it, but any modifications you deploy over a network must also be made available under the AGPL. This is the key distinction from the GPL: if you run a modified version of Forem as a web service, your users gain the right to receive that source. For internal-only deployments where external users never interact with the service, the network provision does not apply. Organizations that need to run proprietary modifications without sharing them must evaluate whether their use case triggers the network clause.

Running Forem yourself is a non-trivial operational commitment. The stack requires PostgreSQL with the pgvector extension (0.8.0+) as a hard dependency, Redis for sessions and background queues, Sidekiq workers for background processing, and optionally a Gemini API key to enable AI-powered features like semantic feeds and content moderation. The recommended deployment path is Kamal 2 with Docker, which requires SSH access to target servers and a container registry. You are responsible for database backups, SSL termination, CDN configuration (Fastly integration is built in but optional), asset storage (S3-compatible or Cloudinary), and keeping Rails and the gem dependencies patched. The commit cadence is very high—over 100 commits per month—so staying current requires active maintenance attention.

There is no commercial hosted tier from the Forem team at this time; the dev.to hosting has not been offered as a managed SaaS product for third parties since Forem’s launch. This means you get full control over data and customization, but there are no SLAs, no managed upgrade path, no enterprise support contracts, and no cloud backup service. The trade-off compared to hosted community platforms like Circle, Discourse Cloud, or Mighty Networks is total ownership of your data and code at the cost of full operational responsibility.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search