Getting started with Standard Notes for encrypted note-taking

Getting started with Standard Notes for encrypted note-taking

Get step-by-step instructions for getting up and running with Standard Notes.

computer screen
Image by : 

opensource.com

x

Get the newsletter

Join the 85,000 open source advocates who receive our giveaway alerts and article roundups.

Standard Notes is a simple, encrypted notes app that aims to make dealing with your notes the easiest thing you'll do all day. When you sign up for a free sync account, your notes are automatically encrypted and seamlessly synced with all your devices.

There are two key factors that differentiate Standard Notes from other, commercial software solutions:

  1. The server and client are both completely open source.
  2. The company is built on sustainable business practices and focuses on product development.

When you combine open source with ethical business practices, you get a software product that has the potential to serve you for decades. You start to feel ownership in the product rather than feeling like just another transaction for an IPO-bound company. 

In this article, I’ll describe how to deploy your own Standard Notes open source syncing server on a Linux machine. You’ll then be able to use your server with our published applications for Linux, Windows, Android, Mac, iOS, and the web.

If you don’t want to host your own server and are ready to start using Standard Notes right away, you can use our public syncing server. Simply head on over to Standard Notes to get started.

Hosting your own Standard Notes server

Get the Standard File Rails app running on your Linux box and expose it via NGINX or any other web server.

Getting started

These instructions are based on setting up our syncing server on a fresh CentOS-like installation. You can use a hosting service like AWS or DigitalOcean to launch your server, or even run it locally on your own machine.

  1. Update your system:

    sudo yum update
  2. Install RVM (Ruby Version Manager):

    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

    \curl -sSL https://get.rvm.io | bash -s stable
  3. Begin using RVM in current session:

    source /home/ec2-user/.rvm/scripts/rvm
  4. Install Ruby:

    rvm install ruby

    This should install the latest version of Ruby (2.3 at the time of this writing.)

    Note that at least Ruby 2.2.2 is required for Rails 5.

  5. Use Ruby:

    rvm use ruby
  6. Install Bundler:

    gem install bundler --no-ri --no-rdoc
  7. Install mysql-devel:

    sudo yum install mysql-devel
  8. Install MySQL (optional; you can also use a hosted db through Amazon RDS, which is recommended):

    sudo yum install mysql56-server
    sudo service mysqld start
    sudo mysql_secure_installation
    sudo chkconfig mysqld on

    Create a database:

    mysql -u root -p
    > create database standard_file;
    > quit;
  9. Install Passenger:

    sudo yum install rubygems
    gem install rubygems-update --no-rdoc --no-ri
    update_rubygems
    gem install passenger --no-rdoc --no-ri
  10. Remove system NGINX installation if installed (you’ll use Passenger’s instead):

    sudo yum remove nginx
    sudo rm -rf /etc/nginx
  11. Configure Passenger:

    sudo chmod o+x "/home/ec2-user"
    sudo yum install libcurl-devel
    rvmsudo passenger-install-nginx-module
    rvmsudo passenger-config validate-install
  12. Install Git:

    sudo yum install git
  13. Set up HTTPS/SSL for your server (free using Let'sEncrypt; required if using the secure client on https://app.standardnotes.org):

    sudo chown ec2-user /opt
    cd /opt
    git clone https://github.com/letsencrypt/letsencrypt
    cd letsencrypt

    Run the setup wizard:

    ./letsencrypt-auto certonly --standalone --debug

    Note the location of the certificates, typically /etc/letsencrypt/live/domain.com/fullchain.pem

  14. Configure NGINX:

    sudo vim /opt/nginx/conf/nginx.conf

    Add this to the bottom of the file, inside the last curly brace:

    server {
        listen 443 ssl default_server;
        ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
        server_name domain.com;
        passenger_enabled on;
        passenger_app_env production;
        root /home/ec2-user/ruby-server/public;
      }
  15. Make sure you are in your home directory and clone the Standard File ruby-server project:

    cd ~
    git clone https://github.com/standardfile/ruby-server.git
    cd ruby-server
  16. Set up project:

    bundle install
    bower install
    rails assets:precompile
  17. Create a .env file for your environment variables. The Rails app will automatically load these when it starts.

    vim .env

    Insert:

    RAILS_ENV=production
    SECRET_KEY_BASE=use "bundle exec rake secret"

    DB_HOST=localhost
    DB_PORT=3306
    DB_DATABASE=standard_file
    DB_USERNAME=root
    DB_PASSWORD=
  18. Setup database:

    rails db:migrate
  19. Start NGINX:

    sudo /opt/nginx/sbin/nginx

    Tip: you will need to restart NGINX whenever you make changes to your environment variables or the NGINX configuration:

    sudo /opt/nginx/sbin/nginx -s reload
  20. You’re done!

Using your new server

Now that you have your server running, you can plug it into any of the Standard Notes applications and sign into it.

On the Standard Notes web or desktop app:

Click Account, then Register. Choose "Advanced Options" and you’ll see a field for Sync Server. Enter your server’s URL here.

On the Standard Notes Android or iOS app:

Open the Settings window, click "Advanced Options" when signing in or registering, and enter your server URL in the Sync Server field.

For help or questions with your Standard Notes server, join our Slack group in the #dev channel, or visit our help page for frequently asked questions and other topics.

About the author

Mo Bitar - Passionate about product and software. Working on Standard Notes, a safe place for your life's work.