Self-hosting Standard Notes on your Synology NAS

You can self-host Standard Notes on your Synology NAS to gain private end-to-end encrypted notes and files securely accessible via the Standard Notes app on all your devices, even when you are on the go and on an external network. All data will be stored on your personal NAS system in the privacy of your own home.

The following instructions were tested on a Synology DS220+ system.

Quick Start

  1. Install the official Docker package on your Synology server via the Package Center by searching for "Docker".

  2. Install the Git Server package.

  3. SSH into your server by following the official instructions.

  4. Once inside your server via command line, change your working directory to the location you'd like to place your Standard Notes related data. In this example, we've chosen /volume1/MySharedFolder. You can navigate to this folder via:

    cd /volume1/MySharedFolder
    
  5. Clone the Standard Notes self-hosted server:

    git clone https://github.com/standardnotes/self-hosted.git
    cd self-hosted
    
  6. Initialize the server:

    ./server.sh setup
    ./server.sh generate-keys
    
  7. By default, the server will run on port 3000 of your NAS server. You can change this by modifying EXPOSED_PORT in the .env file, located in self-hosted/.env.

  8. Start the server:

    ./server.sh start
    
  9. If you encounter any issues, see Troubleshooting below.

  10. During the first start of the server, the infrastructure must create and setup your database. This can take some time, depending on your system. In our tests on a Synology DS220, this process took about 15 minutes. You can run ./server.sh status to observe real-time status and logs.

  11. Allow devices to access the server:

    1. In your Synology Control Panel, select Connectivity > External Access > Router Configuration.
    2. Select Create > Built-in application and check "Docker api-gateway-self-hosted" and "Docker files-self-hosted".
    3. Select Done.
    4. Select Apply in the bottom right corner, if necessary.

You're now up and running with Standard Notes on your Synology NAS! You can verify your server is working by accessing the server endpoint from a web browser by visiting http://{YOUR_SERVER_IP}:3000.

Troubleshooting

  • If you encounter errors related to permissions, you may prepend your commands with sudo to run those commands with root privileges.

    • You may also need to change the permissions of your data directory: sudo chmod -R 755 ./data/
  • If you encounter issues stating that a folder in the data directory could not be found or does not exist, such as data/mysql, simply create those folders:

    mkdir data/mysql
    mkdir data/revisions-db
    

Using your server in the Standard Notes app

Using the Standard Notes desktop app:

  1. In the account menu, choose Advanced options and enter the address of your new server in Custom sync server.
  2. Register for a new account or log in to an existing account and begin using your private new secure Standard Notes server!

Note:

  • You will not yet be able to access your server from the web app or from the mobile app. Keep reading to learn how to expand access to your other devices.
  • File uploads and downloads will not yet work either. We will cover this below.

Accessing your Standard Notes server from other devices

We'll use Tailscale to allow secure access to your self-hosted server from your other devices, no matter where you are in the world.

  1. Install Tailscale on your Synology NAS from the Package Center.

  2. Complete the Tailscale setup wizard until you are presented with the final IP address of your server. It should start with something like 100.xxx.... In this guide, we'll assume the value of 100.130.196.145 for your server Tailscale-based IP.

  3. Install and configure Tailscale on your desktop computer, signing in with the same account you used on your server.

  4. Install and configure Tailscale on your mobile device.

  5. Stop your Standard Notes server:

    ./server.sh stop
    
  6. Edit the .env file. You can use Vim to open the file in your SSH session:

    vim .env
    
  7. Locate the line that says FILES_SERVER_URL and modify the value to equal the Tailscale-based IP address of your Synology NAS, followed by 3125 for the port.

    FILES_SERVER_URL=http://100.130.196.145:3125
    
  8. Start the server via ./server.sh start.

You can now access your self-hosted server from your mobile device by connecting to the Tailscale VPN. When signing into your account using the Standard Notes mobile app, enter your Synology's Tailscale-based IP address and the self-hosted port. In this example, that would be http://100.130.196.145:3000.

Creating a subscription on your server

To access server-side premium features, you'll need to create a subscription for your account (replace EMAIL@ADDR with your user email):

./server.sh create-subscription EMAIL@ADDR

Note that subscriptions created on your self-hosted server in this manner unlock server side premium features, but not client-side premium features (such as Super notes and Nested tags). To gain the full benefits of the Standard Notes ecosystem, you'll need to purchase an offline plan.

Accessing your account using the Standard Notes web app

If you plan to access your server from the web app at https://app.standardnotes.com, your server will need an HTTPS certificate. This is because web browsers do not allow a secure page (beginning with https) to access non-secure servers (beginning with http).

Adding an HTTPS certificate to your Synology setup is outside the scope of this guide, but you can take a look at our generic HTTPS instructions for Linux-based servers. These instructions will likely need to be custom-fitted with Tailscale in order to work correctly.

Other ways to get help

Browse or post to the forum
Recommended for non-account related issues.
Join the Standard Notes Discord group
Recommended for small talk.
Send an email to help@standardnotes.com
Recommended for account related issues.