blog/_posts/2017-11-06-how-to-install-l...

94 lines
4.6 KiB
Markdown

---
title: "How to deploy Laverna on its own server ?"
date: 2017-11-06
url: how-to-deploy-laverna-on-its-own-server
layout: post
category: Tutorials
image: /img/blog/how-to-deploy-laverna-on-its-own-server_1.png
---
[![A missing blog post image](/img/blog/how-to-deploy-laverna-on-its-own-server_1.png)](/img/blog/how-to-deploy-laverna-on-its-own-server_1.png)
### Wait, what is Laverna ?
Yeah sorry, I skipped the most important part :fearful:
[Laverna](https://laverna.cc/) is described as the _"open source alternative to Evernote"_, and guess what ? I agree with that.
Shortly, this JS application allows you to manage your own notes easily, and corresponding data are actually stored **within your browser** (through its [Local Storage](https://www.w3schools.com/html/html5_webstorage.asp)).
[![A missing blog post image](/img/blog/how-to-deploy-laverna-on-its-own-server_4.png)](/img/blog/how-to-deploy-laverna-on-its-own-server_4.png)
In order to access and modify them "everywhere" (hello the _Cloud_ :cloud:), you will have to set a personal synchronization system on your own (see the latest part below).
> I'm ready for this, what do I have to do ?
### Laverna
Well, pretty simple : just fetch the "pre-built" application, and set it into a directory mapped by your web server (we'll be using _Apache_ here) :
{% highlight shell %}
cd /var/www/html/
git clone https://github.com/Laverna/static-laverna.git
{% endhighlight %}
> It's done ! What next ?
### Apache
We'll configure a new site with _Apache_, pretty easy too (we'll create a new _Virtual Host_, but you can also add this site as a new _Directory_ to an existing _VHost_) :
`# nano /etc/apache2/sites-available/laverna.conf`
Add a new _VHost_ handling queries to _Laverna_ :
{% highlight apache %}
<VirtualHost *:80>
ServerName your.server.domain
DocumentRoot /var/www/html/static-laverna/
<Directory /var/www/html/static-laverna/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Allow from all
</Directory>
</VirtualHost>
{% endhighlight %}
Activate the new site and reload _Apache_ to parse and apply its configuration :
`# a2ensite laverna && service apache2 reload`
Now, just go to <http://your.server.domain/>, you should get the same content as on the official page : <https://laverna.github.io/static-laverna/> :tada:
> What a JS app !
> You said data are stored locally, how I'm supposed to synchronize my notes across devices now ?
### Dropbox
> What ?! Dropbox ? You made me quit Evernote to use another centralized-business application afterwards ?
>> &mdash; Actually... Yeah :rofl:
[![A missing blog post image](/img/blog/how-to-deploy-laverna-on-its-own-server_2.png)](/img/blog/how-to-deploy-laverna-on-its-own-server_2.png)
Explanations : The "database" tree containing your notes is fully encrypted, with the same password you may have set beforehand in _Laverna_'s settings. So centralized or not, no third party entity may access your personal stuff. Dropbox infrastructure "is just" a way to automatically store and backup your data elsewhere than your browser.
Otherwise, you can also set up a [Remote Storage](https://remotestorage.io) connection, but I haven't tested it yet.
[![A missing blog post image](/img/blog/how-to-deploy-laverna-on-its-own-server_3.png)](/img/blog/how-to-deploy-laverna-on-its-own-server_3.png)
To add Dropbox synchronization to your existing new _Laverna_ app, just follow the steps described [here](https://github.com/Laverna/laverna/wiki/FAQ#how-to-connect-laverna-with-dropbox).
You'll need a Dropbox account (of course), and... nothing more :wink:
**:construction: Of course, if you don't want or can't set up a synchronization process, you can still export your data and settings into respectively _.ZIP_ and _.JSON_ files, importable into other _Laverna_ instances ! :construction:**
---
This project is still under active development, so don't forget to wait and see (and pull !) to enjoy latest changes.
You can also support the project with [these links](https://github.com/Laverna/laverna#donation).
PS : This post was the first about my slow migration from _Google_ services to free alternatives. I used to enjoy _Google Keep_, but it didn't even handle Markdown syntax :rofl:
~~If you're interesting in testing this, my third instance is running here (you are free to use it personally).~~
**EDIT 2018-11-29 : This instance has been dismantled because I was not using it anymore.
If you actually read this blog post today, I advise you to take a look at [Encryptic](https://github.com/encryptic-team/encryptic), as [Laverna is not maintained anymore](https://github.com/Laverna/laverna/issues/971).**