After explaining how to build the Nylas N1 email client in my previous post, it’s not time to configure the Sync Engine itself. But before delving into this, a little introduction is in order.
Hosted or self-hosted?
There are two ways to use Nylas:
- Using their own servers (through a subscription)
- Hosting the Sync Engine yourself
The API and Sync Engine Services are offered on both a hosted and downloadable basis. If you choose to access the API and Sync Engine Services on a hosted basis, Nylas will store copies of your end users’ email inboxes, calendar events, and contacts information on Nylas’ servers and keep such copies synced.
While I am sure the guys over at Nylas are taking care of the security of their systems, I just don’t feel comfortable adding another player in the mix who has access to all this information. So for me this option is definitely a no go.
Alternatively, if you choose to download the software implementing the API and Sync Engine Services (“API and Sync Engine Software”) onto a local machine, then your end users’ email inbox data, calendar events, and contacts information will be copied, synced, and stored on such local machine.
And this is something I like. Therefore, off we go configuring the sync engine.
VM or bare metal?
If you look at the official installation instructions for the Sync Engine, you can see that Nylas simply recommends downloading the project and using Vagrant to run the VM with the Sync Engine. While this is definitely the easiest and quickest solution if you are just playing out with the project, it is not mandatory.
The good thing is that, even if it’s maybe not clear from the documentation, running a VM is not necessary. You can definitely install the Sync Engine on bare metal, which is what this guide is going to focus on.
For this, I am going to use Ubuntu Server 16.04-1 LTS.
How to install the Nylas Sync Engine
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libssl-dev
- There is currently a little bug in the install script that doesn’t install the libssl-dev package, so we need to install this manually
git clone https://github.com/nylas/sync-engine.git
sudo -H ./setup.sh
If you get a warning about upgrading to pip version 8.12 from a previous version, run
sudo -H pip install --upgrade pip
and then run the setup script again
- The -H option is used to avoid pip from complaining that the user root is not the owner of the current cache directory in use
- Launch the API service:
- Launch the sync service:
- Add your first email account:
And there you go, your Nylas Sync Engine is now up and running and you can connect to it from your N1 client. You simply have to choose the “Hosting your own sync engine?” option on the N1 welcome screen:
Enter your Sync Engine IP and use port 5555 and you are ready to go ;)