Getting Started with NostalgiaPHP
NostalgiaPHP is a caveman-simple, file-based CMS.
No database. No build step. No framework. Just drop in some Markdown files, and you’re publishing.
Requirements
- PHP 7.4+ (works on modern PHP versions)
- A web server with rewrites enabled (Apache
.htaccessor Nginxtry_files) - That’s it. No Node, no npm, no Composer, no database.
Quickstart (local dev)
- Clone or download the project:
git clone https://github.com/bmehder/NostalgiaPHP.git
cd NostalgiaPHP
- Start PHP’s built-in server:
php -S localhost:8000
- Open http://localhost:8000 in your browser.
Project Structure
nostalgia-php/
│── routes/ # routing logic (pages, collections, admin, etc.)
├── content/
│ ├── pages/ # static pages (Markdown)
│ └── collections/ # groups like blog, docs
├── partials/ # header, footer, hero, card, etc.
├── templates/ # layouts (main, sidebar, admin)
├── static/ # css, images, js
├── config.php # site settings
├── functions.php # helpers
├── index.php # router entry point
└── ...other files # htaccess, dockerfile, Parsedown, README
- Pages live in
content/pages/as.md.
Example:about.md→/about - Collections are folders under
content/collections/.
Example:content/collections/blog/hello-world.md→/blog/hello-world - Partials (
partials/) are reusable chunks. - Templates (
templates/) define page layouts. - Routes (
app/routes/) handle how requests map to content.
First Edits
- Change the site name in
config.php:
'site' => [
'name' => 'My First NostalgiaPHP Site',
'base_url' => '/',
'timezone' => 'America/New_York',
],
-
Edit
content/pages/about/index.mdto change the about text. -
Add a new page:
- Create
content/pages/sample/index.md:
---
title: Sample Page
description: Learn more about our team.
---
# Sample Page
We’re building simple sites with simple tools.
- Visit http://localhost:8000/sample.
- Add a new collection:
Edit config.php and add a block like:
'collections' => [
'team' => [
'permalink' => '/team/{slug}',
'list_url' => '/team',
'sort' => ['date', 'desc'],
],
],
Then add items under content/collections/team/.
Deployment
- Apache: use the included
.htaccessfor pretty URLs. - Nginx: add
try_files $uri $uri/ /index.php?$query_string;. - Permissions: make sure directories are
755and files are644.
✅ That’s it — edit Markdown, refresh the browser, and your site updates.