A lightweight, self-hosted content management system written in Go.
goFolio is a minimal content management system built with simplicity as the guiding principle. It serves a public site with posts and pages, and provides an admin panel for managing content, all backed by a single SQLite database. There is no JavaScript framework, no external database server, and no configuration ceremony: build the binary, point it at a directory, and it runs.
The public site is server-rendered HTML: a homepage listing published posts, a view for each individual post and page, and the same content published as JSON under /api for anything that wants to consume it. Admin pages are rendered server-side as well, and both sides are progressively enhanced with HTMX.
The admin panel is server-rendered: each page arrives as complete HTML with its data already in place, avoiding the loading flashes of the previous client-side rendering. Interactive behaviour is built from small HTML fragments served by dedicated endpoints. The posts and pages tables drop rows after a delete, the dashboard's recent-posts list refreshes itself on a timer, and the login form, the password change in settings and the two content editors all post over HTMX and swap their feedback into the page in place. Every one of these flows also works as a plain form submission with JavaScript disabled, since HTMX attributes degrade to normal form posts. The editors load their content from the server as well, so the only JavaScript they need beyond HTMX is the TinyMCE initialisation that turns a textarea into a rich text field. Editor and admin templates live in web/themes, and the fragment rendering logic lives in internal/handler/web.
Requirements are Go 1.26 or newer and, for building inside containers only, Docker. SQLite support is compiled in through the mattn/go-sqlite3 driver, so a C toolchain is needed to build (gcc and musl on Alpine, gcc or clang elsewhere).
To run locally:
make runThis builds and starts the server on port 8080, creates gofolio.db in the working directory if it does not exist, applies migrations, and ensures a default administrator exists. To build a release binary:
make build
./gofolioTo run the full test suite, including unit and integration tests:
make testThe server reads its configuration from environment variables, all of which have sensible defaults for local development.
| Variable | Default | Purpose |
|---|---|---|
PORT |
8080 |
Port the HTTP server listens on |
DOMAIN |
localhost |
Domain shown in the startup message |
DATABASE_PATH |
./gofolio.db |
Path to the SQLite database file |
AUTH_SECRET |
generated | Secret key for session cookies |
In production, set AUTH_SECRET explicitly; otherwise a random value is generated at startup, which invalidates all sessions on every restart. Sessions are cookie-based with a 24 hour lifetime.
A default administrator is created on first boot with the username admin and the password password. Change this password immediately after the first login. The startup log prints a reminder as well.
A multi-stage Dockerfile builds a static binary and ships it in a minimal Alpine image. The container stores its database under /app/data, which should be mounted as a volume so content survives restarts:
docker-compose up --build -dThe image exposes port 8080 and includes a health check that probes the /healthz/ endpoint, which verifies both process liveness and database reachability.
The repository follows the layout described in detail in docs/folder-structure.md. Application entry points live under cmd/server. Domain logic is organised in internal, split into core for routing, handler for HTTP endpoints and middleware, service for business rules, model for data structures, and store for persistence. Shared reusable utilities live in pkg. Admin and public themes, including their stylesheets, are under web/themes. Integration tests live in test/integration.
The documentation index leads to the fuller notes: the architecture and request lifecycle, the route table, the template and HTMX conventions, the database schema and migration rules, authentication and its known gaps, the test layout, and how to deploy the binary or the container image.
Passwords are hashed with bcrypt. Session cookies are marked HttpOnly. Authentication for the admin panel is enforced by middleware on every admin route. The application is suitable for small, self-hosted deployments; anyone exposing it publicly should review the session cookie Secure flag, which is currently disabled pending HTTPS deployment.
The Gopher character featured in the banner is based on the Go mascot, designed by Renée French and used under the Creative Commons 3.0 Attributions license.
The admin rich-text editor is TinyMCE, © Ephox Corporation / Tiny Technologies, Inc., released under GPLv2+, self-hosted under the same GPL terms as this project.
goFolio CMS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the license is available at https://www.gnu.org/licenses/.