Everything needed to run TinyBlog on ordinary PHP hosting: upload the files, create or configure the first admin, embed a feed or subscribe box, and keep the security path visible.
Upload the project to a PHP 8 host with PDO SQLite, make data/ and uploads/ writable, then visit /admin to create the first admin account or log in with credentials configured in a private .env file. No default password ships with the app.
01
Upload tinyblog.php, tinyblog-widget.js, .htaccess, assets/, uploads/, and data/.htaccess to your site root or /blog subfolder.
02
Enable PHP 8.0 or newer, plus pdo_sqlite, sqlite3, and fileinfo when your host exposes extension toggles.
03
Open /admin, or first set TB_ADMIN_EMAIL and TB_ADMIN_PASSWORD in .env, then follow the "Finish setting up" checklist on Home: name the blog, publish a post, and use Add to site to allow your website and copy the snippet.
04
Paste the widget snippet on an allowed page and publish sample posts if you want starter content.
Docs 02
Deployment
TinyBlog targets Namecheap-style cPanel hosting with Apache, PHP 8+, and SQLite. The app creates data/tinyblog.db on first run.
terminal
chmod 755 data uploads
chmod 644 tinyblog.php tinyblog-widget.js .htaccess
# If PHP runs as another user and SQLite cannot create the DB:
chmod 775 data uploads
Keep data/ outside the public web root when your host allows it. If it must stay public, the included .htaccess denies direct downloads of databases, logs, and .env. Known login link: use /admin after editing credentials in the backend file.
The widget is dependency-free and reads JSON from your own TinyBlog endpoint. Admin -> Add to site builds the snippet for you: allow the website, pick a layout and theme, choose your platform (any HTML, WordPress, Shopify, Squarespace, Webflow, Wix, or a PHP include), copy, and it shows "Seen on your-site" once the embed loads. Refused websites appear there with a one-click Allow, and the widget logs the reason in the browser console.
Configuration is passed as JSON in data-tb-config or directly to TinyBlogWidget.init().
Key
Use
endpoint
Required API base URL, for example https://blog.example.com/api.
site
Public site id. Defaults to store-1.
siteKey
Optional public key if API reads require it (Settings -> General -> Advanced). Add to site includes it automatically.
widgetType
feed, post, subscribe, or badge (a "What's new" button with an unread count).
slug
Required for post widgets.
maxItems
Feed item count from 1 to 50.
theme
light, dark, card, or inherit (uses your page's font and colors with no box).
accent
Hex color for buttons, the badge count, and focus rings. Defaults to ink #15130f; dark mode uses ember.
container
Optional CSS selector for manual placement.
Feed responses include items, page, and hasMore while preserving the older posts array. Long posts expose reading_minutes and reading_time.
Docs 05
Routes
The PHP file serves canonical pages, feeds, admin actions, and the JSON API from the same code path.
Route
Purpose
GET /
Public archive listing.
GET /post/{slug}
Canonical post page with SEO, social meta, reading time, and BlogPosting JSON-LD.
GET /tag/{tag}?page=2
Paginated tag listing.
GET /search?q=term&page=2
Paginated prepared-statement search with FTS5 fallback support.
GET /feed.xml
RSS feed.
GET /feed.json
JSON Feed 1.1.
GET /api/posts?site=SITE
Widget/API feed payload.
GET /api/posts/{slug}?site=SITE
Single post API payload.
POST /api/subscribe
Rate-limited, double opt-in subscriber capture.
GET /embed/feed.html?site=SITE
Sanitized HTML fragment of recent posts for server-side includes; limit, excerpt=0, and css=0 are optional.
GET /admin
Home with setup checklist, Posts, Media, Subscribers, Add to site, and Settings (General, Email, Users, Embed & sites, Backup & health).
Docs 06
Security defaults
TinyBlog keeps the sensitive path small and inspectable: prepared SQL, escaped output, sanitized Markdown, browser-side widget sanitization, CSRF tokens, rate limits, password hashing, session timeout, image-only uploads, and exact-origin CORS allowlists.
Production checklist
Enable HTTPS before creating the first admin.
Use a unique admin password of at least 12 characters.
Restrict allowed widget origins to exact domains.
Keep .htaccess and uploads/.htaccess in place.
Back up data/tinyblog.db and uploads/ regularly.
Confirm raw Markdown HTML is escaped, not executed.
Auth flow caveats
Set TB_ADMIN_EMAIL and TB_ADMIN_PASSWORD_HASH before public launch when possible; otherwise the first visitor to /admin can create the first admin.
Prefer TB_ADMIN_PASSWORD_HASH over plaintext TB_ADMIN_PASSWORD; plaintext credentials are only for short setup or recovery windows and depend on .env staying private.
Remove TB_ADMIN_* values after bootstrap or recovery if you do not want the backend file to keep re-applying that admin password and role.
Force HTTPS and HSTS at the host so login credentials and session cookies never travel over plain HTTP.
Docs 07
Backups and moving hosts
Use Settings -> Backup for JSON export/import of posts, settings, confirmed subscribers, and media references. Copy uploads/ alongside the JSON when restoring elsewhere.
Move to Postgres when multiple authors, higher write volume, or large subscriber lists make SQLite locking noticeable. Move media to object storage when uploads outgrow shared-hosting disk. Move to a larger publishing stack only when you need webhooks, background jobs, team permissions, or multi-site tenancy.
Docs 10
Changelog highlights
2026-11-17
v0.2: an admin built around the job
New identity and palette, a rebuilt landing page, and an admin organised as Home, Posts, Media, Subscribers, Add to site, and Settings. Adds a setup checklist, Draft / Publish now / Schedule in local time, server-rendered preview, media picker, required alt text, embed verification with one-click Allow, subscriber CSV export, tabbed settings with a test email, the /embed/feed.html fragment, and the widget's inherit theme and badge mode. The subscribe API no longer returns confirm links.
2026-07-04
Publishing, widget, docs, and operations polish
Added landing-page polish, scheduled publishing, pagination, reading time, robust widget states, JSON-LD, subscriber confirmation, FTS5 fallback search, related and pinned posts, media management, backups, JSON Feed, copyable code blocks, and conditional GET headers.
2026-05-14
Security hardening
Added CSP/security headers, .env-style configuration, file logging, admin role checks, object-scoped editing, site-scoped subscribers, smoke checks, and setup notes.