Install WriteFreely

Install WriteFreely
Photo by Kelly Sikkema / Unsplash
Getting Started with WriteFreely
An open source platform for quickly publishing to the web.

Initial set up

  1. Spin up new webdock.io perfect LEMP server
  2. Via admin interface add new sudo user, associate SSH key
  3. Via admin interface create new database with new user (make a note of the password)
  4. Set up DNS A record to the new server (required for SSL later)
  5. SSH to server and update: sudo apt update && sudo apt upgrade

Install and configure

# download latest release (check github releases page)
curl -OL https://github.com/writefreely/writefreely/releases/download/v0.13.1/writefreely_0.13.1_linux_amd64.tar.gz

# create dir for blog
sudo mkdir /var/www/blog.site.com

# extract files (without writefreely subdir)
sudo tar -xzvf writefreely_0.13.1_linux_amd64.tar.gz -C /var/www/blog.site.com --strip-components=1

# configure
cd /var/www/blog.site.com
sudo ./writefreely config start
# Production, behind reverse proxy
# Port 8080
# MySQL, enter username, password and database name as created above
# Single-user blog (or as you wish)
# Enter admin name and password
# Enter blog name e.g. "Quirky new blog"
# Enter blog URL e.g. https://blog.site.com
# Federation: enabled (if you want to federate to fediverse)
# Usage stats: public
# Instance metadata privacy: private (no idea what this is)

# should now create tables and users (< 1 sec)

# generate keys
sudo ./writefreely keys generate

# run and check no errors
sudo ./writefreely

Set up service

sudo vi /etc/systemd/system/writefreely.service

# add contents of file at https://writefreely.org/start
  - comment and uncomment After to use MySQL
  - update WorkingDirectory location
  - update ExecStart location

sudo systemctl start writefreely

# check no errors
sudo journalctl -f -u writefreely 

Site should now be up and running at http://localhost:8080 - curl http://localhost:8080 should spit out some html

Set up reverse proxy

sudo vi /etc/nginx/sites-available/blog.site.com

# add contents of file at https://writefreely.org/start
  - update server_name
  - update location root

sudo ln -s /etc/nginx/sites-available/blog.site.com /etc/nginx/sites-enabled/blog.site.com
sudo nginx -t # validate config
sudo systemctl restart nginx

# get a certificate
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d blog.site.com
# 2. redirect all HTTP traffic to HTTPS

Site should now be available externally via HTTPS