Install a WriteFreely Blog

Complete WriteFreely Installation Tutorial (Ubuntu 24.04)

This tutorial provides a complete, beginner‑friendly, end‑to‑end installation of WriteFreely on Ubuntu 24.04. Every step is included — no assumptions, no missing commands, and no unexplained jumps.


1. Before You Begin

What You Will Build

A fully functional WriteFreely instance running on:

  • Ubuntu 24.04

  • MariaDB

  • Systemd service

  • Nginx reverse proxy

  • HTTPS via Certbot

Requirements

  • A domain name pointing to your server’s IP

  • A fresh Ubuntu 24.04 server

  • SSH access


2. Update the System

sudo apt update && sudo apt upgrade -y

Install basic tools:

sudo apt install unzip curl wget -y


3. Install and Secure MariaDB

sudo apt install mariadb-server -y

Secure the installation:

sudo mysql_secure_installation

Choose:

  • Switch to unix_socket auth? N

  • Set root password? Y

  • Remove anonymous users? Y

  • Disallow remote root login? Y

  • Remove test database? Y

  • Reload privilege tables? Y


4. Create the WriteFreely Database

Log into MariaDB:

sudo mysql -u root -p

Create the database:

CREATE DATABASE writefreely;

Create a dedicated database user:

CREATE USER 'wfuser'@'localhost' IDENTIFIED BY 'yourpassword';

Grant privileges:

GRANT ALL PRIVILEGES ON writefreely.* TO 'wfuser'@'localhost';

Apply changes:

FLUSH PRIVILEGES;
EXIT;


5. Create the WriteFreely System User

sudo adduser --system --group --home /opt/writefreely writefreely


6. Download and Install WriteFreely

Navigate to /opt:

cd /opt

Download the latest release (example version):

wget https://github.com/writefreely/writefreely/releases/download/v0.15.0/writefreely_0.15.0_linux_amd64.tar.gz

Extract:

tar -xzf writefreely_0.15.0_linux_amd64.tar.gz

Move into place:

sudo mv writefreely /opt/writefreely

Set ownership:

sudo chown -R writefreely:writefreely /opt/writefreely


7. Configure WriteFreely

Switch to the WriteFreely user:

sudo -u writefreely -H bash
cd /opt/writefreely

Generate the config file:

./writefreely config

Follow prompts:

  • App Name: Your site title

  • Public URL: https://yourdomain.com

  • Database: MySQL

  • DB Name: writefreely

  • DB User: wfuser

  • DB Password: yourpassword

  • Listen Port: 8080

Exit the writefreely user shell:

exit


8. Initialize the Database

cd /opt/writefreely
sudo -u writefreely ./writefreely db init


9. Create the Systemd Service

Create the service file:

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

Paste:

[Unit]
Description=WriteFreely Service
After=network.target

[Service]
Type=simple
User=writefreely
Group=writefreely
WorkingDirectory=/opt/writefreely
ExecStart=/opt/writefreely/writefreely
Restart=on-failure

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl daemon-reload
sudo systemctl enable writefreely
sudo systemctl start writefreely

Check status:

sudo systemctl status writefreely


10. Configure Nginx Reverse Proxy

Install Nginx:

sudo apt install nginx -y

Create site config:

sudo nano /etc/nginx/sites-available/writefreely

Paste:

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Enable the site:

sudo ln -s /etc/nginx/sites-available/writefreely /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx


11. Enable HTTPS with Certbot

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com

Follow prompts to enable HTTPS.


12. First‑Run Setup

Visit:

https://yourdomain.com

Create your admin account.

Enable federation in the admin panel if desired.


13. Troubleshooting

WriteFreely service won’t start

Check logs:

sudo journalctl -u writefreely -f

Database connection errors

Verify credentials in:

/opt/writefreely/config.ini

Nginx 502 errors

Ensure WriteFreely is running:

sudo systemctl status writefreely


14. Optional Enhancements

  • Log rotation

  • Backups

  • Caching

  • Multiple users / instances


Complete

Your WriteFreely instance is now fully installed, secured, and running behind HTTPS with a proper systemd service and database configuration.