Publishing From a Laptop
Chinaski can run on a spare or donated Linux laptop: the admin, the database, and the build all live on the laptop, while the public site itself is served from Cloudflare R2 object storage. Editors open the admin in the laptop's browser to write and publish; visitors never touch the laptop at all, so the public site stays up even when the laptop is closed, turned off, or offline.
This is a good fit for anyone who wants a real website with no hosting bill: a community group, a parish, a student, anyone without a card to put on a hosting account. Many laptops end up as e-waste only because of Windows licensing, not because the hardware is bad. Any Debian- or Ubuntu-family Linux (Ubuntu, Linux Mint, Debian and similar) works.
This is a one-time setup, best done by whoever is comfortable with a few terminal commands. After setup, day-to-day publishing needs none of that, just the admin in a browser.
If a phone is the only device available, see Publishing From a Phone instead.
1. Install Chinaski
Open a terminal on the laptop and run:
curl -fsSL https://www.chinaski.net/dist/laptop-quickstart.sh | bash Run this as your normal user, not with sudo. The script asks for your password once, only to install system packages. Everything else installs into your home folder (~/chinaski) and runs as you.
This one command installs the packages Chinaski needs, downloads and checksum-verifies the offline bundle, builds Chinaski's Perl dependencies (a few minutes), sets up the database, and starts Chinaski as a background service.
When it finishes, open http://127.0.0.1:8080/admin in the laptop's browser. The admin only listens on the laptop itself, so it's never reachable from outside.
Manual steps (the same as the command above; useful if something fails)
sudo apt-get update
sudo apt-get install -y perl make gcc sqlite3 openssl libjpeg-dev libpng-dev libgif-dev libwebp-dev rclone rsync curl tar gzip
cd "$HOME"
curl -fSLO https://www.chinaski.net/dist/chinaski-latest.tar.gz
curl -fSLO https://www.chinaski.net/dist/chinaski-latest.tar.gz.sha256
sha256sum -c chinaski-latest.tar.gz.sha256
mkdir extracted
tar -xzf chinaski-latest.tar.gz -C extracted
cd extracted/chinaski-*
bash install.sh --laptop --prefix "$HOME/chinaski"
systemctl --user daemon-reload
systemctl --user enable --now chinaski
loginctl enable-linger "$(whoami)" 2. Keep it running
The install sets Chinaski up as a service for your user account. It starts automatically when you log in, and restarts itself if it ever stops.
The install also tries to let Chinaski start when the laptop boots, before anyone logs in. On a few Linux versions this needs permission once; if the install prints a message about it, run:
sudo loginctl enable-linger "$(whoami)" To check on Chinaski or restart it:
systemctl --user status chinaski
systemctl --user restart chinaski
journalctl --user -u chinaski -f 3. Point it at Cloudflare R2
This is where the public site actually lives.
In Cloudflare:
- Create an R2 bucket with Standard storage. Use this bucket for this site only: every publish makes the bucket match the site exactly and deletes anything else in it.
- Under R2 → Manage API tokens, create an API token with Object Read & Write permission, limited to that bucket. Copy the Access Key ID and Secret Access Key. The secret is shown only once. Note your Account ID from the R2 overview page.
- In the bucket's Settings, connect a custom domain (for example
www.example.com). Cloudflare creates the DNS record and makes the bucket public on that address, with nothing else to switch on. R2's ownr2.devaddress is for testing only. - R2 serves a file only by its exact name, while Chinaski saves pages as
.../index.html. On your domain (under Rules, not R2), add a URL Rewrite Rule:- Filter (custom expression):
(http.host eq "www.example.com" and ends_with(http.request.uri.path, "/"))(with your own address) - Path: rewrite to Dynamic
concat(http.request.uri.path, "index.html")
- Filter (custom expression):
In Chinaski: set Settings → General → Site URL to your public address (for example https://www.example.com), then in Settings → Deploy:
| Field | Value |
|---|---|
| Deploy automatically after a successful build | On |
| Enable S3 deploy | On |
| Bucket | Your R2 bucket name |
| Endpoint | https://<ACCOUNT_ID>.r2.cloudflarestorage.com (nothing after .com) |
| Region | auto |
| Access Key / Secret Key | The R2 API credentials |
Don't put the bucket name on the end of the Endpoint. Cloudflare sometimes shows the address as https://<ACCOUNT_ID>.r2.cloudflarestorage.com/<bucket>. Copied like that, the site is uploaded into a folder inside the bucket and every page shows R2's "Error 404: Is this your bucket?" message, even though Test S3 Connection passes.
Save, then use Test S3 Connection to confirm the credentials work. Publish something, then open your address and a page inside the site to confirm everything loads.
Publishing a change
Edit and save a page or post as normal, and the build and upload run on their own. Watch the admin's status banner for "Publishing your update…" through to "Your update is live."
If a build succeeds but the upload fails (the Wi-Fi dropped, say), the site last published to R2 stays exactly as it was, and visitors never see a half-finished publish. Publish again once you're back online.
Updating Chinaski
To install the latest Chinaski release, run this in a terminal as the same user (not with sudo):
curl -fsSL https://www.chinaski.net/dist/chinaski-update.sh | bash It checks whether a new release is available, installs it, and restarts Chinaski. Your database, settings, uploads and media are kept. Installs made before rsync was part of the package list need it once: sudo apt-get install rsync.
Good to know
- Forms and document downloads: the public site is served by R2, and the laptop isn't reachable from the internet, so contact forms and document downloads on the public site don't work in this setup.
- Costs: Cloudflare R2's free tier covers a typical small site many times over, and traffic to visitors isn't charged. You still pay for your domain name.