= Guide = How to Install Turtl Self-Hosted on Debian

3,491 views
Skip to first unread message

Fred C

unread,
Aug 30, 2016, 9:33:16 AM8/30/16
to Turtl
I struggled a bit to install turtl self-hosted version and found the documentation available not so accessible from the point of view of a less technical user. I also struggled to find a detailed guide with the exact steps on how to install the turtl api on a server (a VPS in my case).

With the precious help of TieMichael here in the forum, and a recent tutorial detailing the installation in Ubuntu 14 found here, I put together a detailed guide for installing Turtl on a Debian 8.




                ==== Tested on Debian 8 minimal ====



    # Start by installing required software:

apt-get install git wget curl libtool subversion gcc make automake




    # 1. Install libuv:

cd /usr/local/src

tar -xf libuv-v1.9.1.tar.gz

cd libuv-v1.9.1

sh autogen.sh

./configure

make

make install





    # 2. Install RethinkDB


    # Add the repo to your sources list and install via apt-get:

cd ~

echo "deb http://download.rethinkdb.com/apt `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list

wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -

apt-get update

apt-get install rethinkdb



    # Now configure the default instance:

cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/default.conf





    # and restart rethinkdb:

systemctl restart rethinkdb










    # 3. Install Common Lisp - I've used Closure CL but SBCL is also an option:



    # Move into the directory to host lisp:

cd /usr/local/src


    # and download the package (http://ccl.clozure.com/download.html):



    # Copy the files to the system folder:

cp /usr/local/src/ccl/scripts/ccl /usr/local/bin

    # or for x64 

cp /usr/local/src/ccl/scripts/ccl64 /usr/local/bin



    # Start lisp with the command:

ccl

    # or

ccl64


    # to exit

(quit)






    # 4. Install quickLisp


    # Create new unprivileged user Turtl:

adduser turtl

su turtl

cd ~




    # Download and install quicklisp and asdf


ccl --load quicklisp.lisp
 
    # or for x64 systems

ccl64 --load quicklisp.lisp



    # Install quicklisp from within the lisp shell:

(quicklisp-quickstart:install)

(ql:add-to-init-file)

(load (compile-file "asdf.lisp"))

    # exit

(quit)


    # Cleanup the install packages:

rm asdf.lisp quicklisp.lisp








    # 5. Download and Install Turtl

git clone https://github.com/turtl/api.git

cd /home/turtl/api




    # Create a file to host lisp commands:

vi launch.lisp



    # and copy the bellow:


(pushnew "./" asdf:*central-registry* :test #'equal)
(load "start")




    # Leave the unprivileged user and go back to root/sudo user:

exit




    # Install a few missing dependencies in quicklisp (there may be unnecessary packages on the list bellow) :

cd /home/turtl/quicklisp/local-projects





    # edit the ccl init conf file:


vi /home/turtl/.ccl-init.lisp



    # and add the bellow at the end:


(cwd "/home/turtl/api")
(load "/home/turtl/api/launch")




    # create the default turtl config file:

cp /home/turtl/api/config/config.default.lisp /home/turtl/api/config/config.lisp



    # edit as needed:

vi /home/turtl/api/config/config.lisp



    # (the only edit I've done was to the *site-url*, *admin-email* and *email-from*)




    # Now it is time to start ccl as turtl user, which should load and build the api automatically:

su turtl

cd ~


ccl

  # or for x64 systems

ccl64


    # turtl will build and creat db schema and launch - you should be able to access the server through a client by pointing it to http://turtl.yourdomain.com:8181 (do not try it in a browser as there currently is no webgui and you will receive a "Authentication failed." error).

    # ctrl + C to leave and (quit) to end lisp; 


    # Go back to root/sudo user by exiting turtl

exit




    # Configure Turtl to start at boot:

vi /etc/rc.local



    # and add at the bottom but before the "exit 0" line:

sudo -u turtl /usr/local/bin/ccl

  # or for x64 systems

sudo -u turtl /usr/local/bin/ccl64




    # Reboot and check that you can connect to turtl through any client on your server's address:

http://turtl.yourdomain.com:8181 



    # For heightened security configure Turtl service through apache or nginx proxy and implement https.




And that's it, you should have a working instance of turtl self-hosted api by now. Hope it helps to those which have been struggling to get it right like me.

Best,
Message has been deleted

rul...@gmail.com

unread,
Aug 31, 2016, 1:24:52 PM8/31/16
to Turtl
These instructions work great.

Only problem I am having is trying to use an apache2 proxy to serve the 8181 ports.

Below is my apache2 configuration:

<VirtualHost *:80>
ServerName turtl.domain.com

ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://127.0.0.1:8181/ Keepalive=On timeout=1600
ProxyPassReverse / http://127.0.0.1:8181/

LogLevel info

CustomLog ${APACHE_LOG_DIR}/turtl.log combined

</VirtualHost>


I have problems logging in, creating users, etc while using the proxy. If I use the ports 8181 directly I have no issues.

For example if I go to the proxied address at turtl.domain.com, I will get two different messages that switches when I hit refresh:

"There was an error processing your request: Authentication failed." or "Authentication failed."

If I connect on the 8181 port I only get "Authentication failed." message, no matter how much I refresh.

Is there some proxy issue with my setup?

Fred C

unread,
Sep 2, 2016, 9:20:27 AM9/2/16
to Turtl
Have you configured the config.lisp file to bind to localhost?

vi /home/turtl/api/config/config.lisp

    # make sure it is as bellow:

(defvar *server-bind* "127.0.0.1"
  "The address to bind Turtl to (nil is the same as 0.0.0.0).")


hope it works.

Jason Reule

unread,
Sep 7, 2016, 6:06:31 PM9/7/16
to Turtl
Yes, Thank you that worked and now I have no more issues!

akada...@gmail.com

unread,
Sep 16, 2016, 12:59:23 AM9/16/16
to Turtl
This is great, and got me fairly far along in setting it up in Gentoo (different set of steps but I won't document if there's no demand). Since Gentoo uses start-stop-daemon in its init scripts and that's derived from Debian (not sure if Ubuntu uses it at all these days), I thought I'd point out I skipped a number of the latter steps with an additional launch.lisp file and running ccl with no arguments by doing this (excuse me for not looking up the markup syntax):


tobiko# cat /etc/init.d/turtl
#!/sbin/openrc-run

depend() {
need rethinkdb.turtl
}

start() {
start-stop-daemon -b -n turtl -u turtl -d /var/lib/turtl/api -p /var/lib/turtl/turtl.pid -S --exec /bin/bash -- -c "/usr/bin/ccl --load start.lisp"
}

stop() {
start-stop-daemon -p /var/lib/turtl/turtl.pid -s SIGKILL turtl
}

sqwee...@gmail.com

unread,
Sep 23, 2016, 2:49:25 PM9/23/16
to Turtl
This worked perfectly for me, the only other thing I had to do was install sudo (not installed by default w/ the iso I used)

eredw...@gmail.com

unread,
Oct 25, 2016, 11:49:40 AM10/25/16
to Turtl
On Tuesday, August 30, 2016 at 8:33:16 AM UTC-5, Fred C wrote:
> I struggled a bit to install turtl self-hosted version and found the documentation available not so accessible from the point of view of a less technical user. I also struggled to find a detailed guide with the exact steps on how to install the turtl api on a server (a VPS in my case).
>
>
> With the precious help of TieMichael here in the forum, and a recent tutorial detailing the installation in Ubuntu 14 found here, I put together a detailed guide for installing Turtl on a Debian 8.


Fred first I want to thank you for your work in putting this together. I tried this on a Ubuntu Sever 16.04 and I failed. I did my best to follow your instructions to the tee. I made sure I could ping the server, before and was able to reach it, but for some reason turlt could not see the server. I work in the IT field but I am not a programmer and from what I see, and I may be wrong, and I am ok with that, but can you explain this to me as if I was a 4 year old. I am not a programmer and when I read this I am lost somewhere in it and it's not working. and I know I set this up just the way your trying to explain it. I am not mad at you my friend just want to set this thing up and drop evernote. can you help me. Thanks in advances.
Message has been deleted
Message has been deleted

TieMichael

unread,
Oct 25, 2016, 11:13:19 PM10/25/16
to Turtl, eredw...@gmail.com
I installed Turtl on Ubuntu 16.04 - server recently. ...and remember some similar issues, caused by 
 - my installation of Turtl.js or more specifically of npm ( I am using npm 3.10.8 )  
 - and to Turtl.api  and config.lisp: 

Here are some of my config.lisp entries : (defvar *db-host* "127.0.0.1"

 
(defvar *enabled-cors-resources* "http://local ip of the server:8182"

 
(defvar *site-url* "https://turtl.mysite.com"

 
(defvar *local-upload* "/home/turtl/data"

 
(defvar *local-upload-url* "https://turtl.mysite.com"


Just try, and feedback as specific as possible the issues you face ... Maybe one more hint: Firefox Developer console gives quite a lot of info
 on the communication between server and host, and might help to pinpoint 
 the issue

 Good luck!

Earnest Redwood

unread,
Nov 13, 2016, 9:46:52 PM11/13/16
to Turtl
I ran this studied it installed it in Slow motions had my wife to go over it with me just to make sure that i followed ever step. it not working  I running this on Ubuntu 15.10. After I install every thing. I can't find the server. Listen I going to stay true to this thing. I thank you for all that you do.

Another problem I am having is Turtl keep up with my pic's see attachment

On Tuesday, August 30, 2016 at 8:33:16 AM UTC-5, Fred C wrote:
missing_pics.jpg

Earnest Redwood

unread,
Nov 14, 2016, 5:47:49 PM11/14/16
to Earnest Redwood, Turtl
Again I want to thank you for all your help: I am not give up on this, I think this is a great product and I can't wait to get this part down. I know you have a lot on your plate, but I am also having issue with saving picture. I think it because is will not show if it not on the computer if you can see my attachment from the last email i sent you. this is what I am seeing when i ring turtl up form another computer.

Earnest L. Redwood


A Dime and Silver Dollar has the same value if there in the middle of a lake and you can't get to it.


--
You received this message because you are subscribed to a topic in the Google Groups "Turtl" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/turtl/q3kAYnAcH0s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to turtl+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TieMichael

unread,
Nov 15, 2016, 3:54:33 AM11/15/16
to Turtl, linuxm...@gmail.com, eredw...@gmail.com
Ernest,
there seems to be an issue with the picture-size. Try to resize to maybe 1024 * 1024 pixel - most likely it will be working ...
Rgds
To unsubscribe from this group and all its topics, send an email to turtl+un...@googlegroups.com.

Earnest Redwood

unread,
Feb 24, 2017, 3:32:29 PM2/24/17
to Turtl
Hey Fred this still working for you. I going to give it shot over the weekend. and get back with you and let you know how it when. I tried this before and did not have success with it. I have a new install of you ubuntu 16.04 LTS server. I see how it works and let you know. What we really is a step by step configuration so that I can take control of my data.
So what you saying is if I follow this setup it should work for me.?



On Tuesday, August 30, 2016 at 8:33:16 AM UTC-5, Fred C wrote:

jgk...@gmail.com

unread,
May 20, 2017, 9:24:38 PM5/20/17
to Turtl
Thanks a ton for this guide. It helped me troubleshoot my issues. I just spent about 10 hours trying all kinds of stuff, and it turns out that the problem was my config file. I had defvar *api-path* set to the actual path of my api folder. This was causing authentication issues with Turtl clients on Windows and Linux when trying to create a new user. I blanked that defvar out (the config file says it can be blank), and VIOLA! It works. I am posting this here, in case someone else has the same problem.

bori...@gmail.com

unread,
Nov 5, 2017, 1:09:35 PM11/5/17
to Turtl
Greetings, and thank you for this thorough tutorial.
Everything works smoothly except for the syncing between android app and linux desktop app.
I raised an issue against the API which is located at

https://github.com/turtl/api/issues/37

Here are my setups. And the log from the terminal.

I would greatly appreciate any help, I spent infinite time trying to setup this software.

u.n.o...@gmail.com

unread,
Apr 19, 2018, 9:31:30 PM4/19/18
to Turtl
It also works on Debian 9 Stretch in my Server.

But I have to install libssl1.0.0 mannully, by downloading it from [Jessie's packages](https://packages.debian.org/jessie/amd64/libssl1.0.0/download). Otherwise ccl64 fails in the end due to lack of
`libssl.so.1.0.0 libssl.so.0.9.8 libssl.so libssl.so.4`

Reply all
Reply to author
Forward
0 new messages