How to Install WriteFreely SQLite on Your Synology NAS

How to Install WriteFreely SQLite on Your Synology NAS

Do you remember my guide on how to install WriteFreely on your Synology NAS that I posted some time ago? The installation instructions I proposed some time ago used MySQL as database. Today I’m proposing instructions for WriteFreely to use the lighter SQLite as database. In this step by step guide I will show you how to install WriteFreely with SQLite as database on your Synology NAS using Docker and Portainer. What is WriteFreely? WriteFreely is a clean, minimalist publishing platform made for writers. WriteFreely supports federation via ActivityPub, a protocol spoken by popular platforms like Mastodon and Pixelfed. This means that other people can directly follow your blog from the decentralized social network known as the “fediverse”, if your WriteFreely admin has enabled federation (STEP 29).

Note: This guide works perfectly with the latest WriteFreely v0.15.0 release.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.

  • STEP 3

Make sure you have a synology.me Wildcard Certificate. Follow my guide to get a Wildcard Certificate. If you already have a synology.me Wildcard certificate, skip this STEP.

  • STEP 4

Install Text Editor via Synology “Package Center”. (Mandatory STEP.) If you already have Text Editor installed on your Synology NAS, skip this STEP.

Synology Install Text Editor 2023

  • STEP 5

Go to Control Panel / Login Portal / Advanced Tab / click Reverse Proxy. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 1

  • STEP 6

Now click the “Create” button. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 2

  • STEP 7

After you click the Create button, the window below will open. Follow the instructions in the image below.

On the General area, set the Reverse Proxy Name description: type in WriteFreely. After that, add the following instructions:

Source:
Protocol: HTTPS
Hostname: writefreely.yourname.synology.me
Port: 443

Check Enable HSTS

Destination:
Protocol: HTTP
Hostname: localhost
Port: 9800

WriteFreely SQLite Synology NAS Set up 3

  • STEP 8

On the Reverse Proxy Rules click the Custom Header tab. Click Create and then, from the drop-down menu, click WebSocket. After you click on WebSocket, two Header Names and two Values will be automatically added. Click Save. Follow the instructions in the image below.

Synology Proxy WebSocket

  • STEP 9

Go to Control Panel / Network / Connectivity tab/ Check Enable HTTP/2 then click Apply. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 4

  • STEP 10

Go to Control Panel / Security / Advanced tab/ Check Enable HTTP Compression then click Apply. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 5

  • STEP 11

Go to File Station and open the docker folder. Inside the docker folder, create one new folder and name it writefreely. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

WriteFreely SQLite Synology NAS Set up 6

  • STEP 12

Log into Portainer using your username and password. On the left sidebar in Portainer, click on Stacks then + Add stack. Follow the instructions in the image below.

1 Synology Portainer Add Stack

  • STEP 13

In the Name field type in writefreely. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

version: "3.9"
services:
   writefreely:
    image: algernon/writefreely:latest
    container_name: WriteFreely
    hostname: writefreely
    security_opt:
      - no-new-privileges:true
    user: 1026:100
    ports:
      - 9800:8080
    volumes:
      - /volume1/docker/writefreely:/data
    environment:
      - WRITEFREELY_SITE_NAME=Mariushosting blog
      - WRITEFREELY_HOST=https://writefreely.yourname.synology.me
    restart: always

Note: Before you paste the code above in the Web editor area below, change the value numbers for user with your own UID and GID values. (Follow my step by step guide on how to do this.) 1026 is my personal UID value and 100 is my personal GID value. You have to type in your own values.
Note: Before you paste the code above in the Web editor area below, change the value for WRITEFREELY_SITE_NAME and type in your own site name. Mariushosting blog is an example for a site name.
Note: Before you paste the code above in the Web editor area below, change the value for WRITEFREELY_HOST and type in your own synology.me DDNS that you have previously created at STEP 7.

WriteFreely SQLite Synology NAS Set up 7

  • STEP 14

Scroll down on the page until you see a button named Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

WriteFreely SQLite Synology NAS Set up 8

  • STEP 15

If everything goes right, you will see the following message at the top right of your screen: “Success Stack successfully deployed“.

WriteFreely SQLite Synology NAS Set up 9

  • STEP 16

On the left sidebar in Portainer, click Containers. Identify your WriteFreely instance, then click on the little terminal icon. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 10

  • STEP 17

After you click on the little terminal icon at STEP 16, a new page will open. From the Command dropdown menu select /bin/sh then click Connect. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 11

  • STEP 18

After you click Connect at STEP 17, a Console will open. Type in the text below. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

cd /data

WriteFreely SQLite Synology NAS Set up 12

  • STEP 19

After pressing enter at STEP 18, type in the text below. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

/writefreely/writefreely --config

WriteFreely SQLite Synology NAS Set up 13

  • STEP 20

Using the arrow keys on your keyboard select “Production, behind reverse proxy” then confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 14

  • STEP 21

After Selecting Production, behind reverse proxy at STEP 20, type in the text below. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

8080

WriteFreely SQLite Synology NAS Set up 15

  • STEP 22

Using the arrow keys on your keyboard select “SQLite” then confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 16

  • STEP 23

After pressing enter at STEP 22, type in the text below. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

writefreely-db

WriteFreely SQLite Synology NAS Set up 17

  • STEP 24

Using the arrow keys on your keyboard select “Single user blog” then confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 18

  • STEP 25

Type in your own Username and confirm by pressing Enter on your keyboard. Follow the instructions in the image below. Note: You will need this Username at STEP 37.

WriteFreely SQLite Synology NAS Set up 19

  • STEP 26

Type in your own Password and confirm by pressing Enter on your keyboard. Follow the instructions in the image below. Note: You will need this Password at STEP 37.

WriteFreely SQLite Synology NAS Set up 20

  • STEP 27

Your blog name should appear automatically. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 21

  • STEP 28

Your DDNS Address should appear automatically. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 22

  • STEP 29

Select to Enable or Disable Federation. I chose Enabled. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 23

  • STEP 30

Select Public for usage stats. This depends on your needs. I chose Public. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 24

  • STEP 31

Select Public for metadata privacy. This depends on your needs. I chose Public. Confirm by pressing Enter on your keyboard. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 25

  • STEP 32

Done. The SQLite database will be written.

WriteFreely SQLite Synology NAS Set up 26

  • STEP 33

Go back to STEP 1 or you will deal with karma 🙂.

  • STEP 34

On the left sidebar in Portainer, click Containers. Identify your WriteFreely instance, select it then click Restart. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 27

  • STEP 35

Go back to STEP 1 or you will deal with karma 🙂.

  • STEP 36

Now open your browser and type in your HTTPS/SSL certificate like this https://writefreely.yourname.synology.me that you have previously created at STEP 7. In my case it’s https://writefreely.mariushosting.synology.me If everything goes right, you will see the main WriteFreely page. At the top left click Log in. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 28

  • STEP 37

Type in your own Username and your own Password that you have previously created at STEP 25 and STEP 26, respectively. Click Login. Follow the instructions in the image below.

WriteFreely SQLite Synology NAS Set up 29

You can start to write on your WriteFreely blog!

WriteFreely SQLite Synology NAS Set up 30

  • STEP 38

If you need to modify something in the configuration of your WriteFreely, like opening user registration to all or preventing new user registration, or enabling or disabling federation, you can do it by going to the writefreely folder that you have previously created at STEP 11 and opening the config.ini file. Note: to be able to open the config.ini file, you need to have installed Synology Text Editor on your NAS as per instructions at STEP 4.

WriteFreely SQLite Synology NAS Set up 31

Apply the changes you want, then save the file. Note: After you save the config.ini file, remember to restart the WriteFreely container like you did at STEP 34 to apply the changes.

WriteFreely SQLite Synology NAS Set up 32

Enjoy WriteFreely with SQLite!

🆘TROUBLESHOOTING

If you encounter issues by using this container, make sure to check out the Common Docker issues article.

Note: Find out how to update the WriteFreely container with the latest image.
Note: Can I run Docker on my Synology NAS? See the supported models.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.

This post was updated on Sunday / February 4th, 2024 at 8:45 PM