×
Community Blog How to Install Turtl Server on Alibaba Cloud ECS

How to Install Turtl Server on Alibaba Cloud ECS

In this tutorial, we will be setting up Turtl on an Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud's incentive program to encourage the sharing of technical kledge and best practices within the cloud community.

Turtl server is open source storage service that focuses on privacy. Turtl stores your password and creates a cryptographic key and uses this key for encryption of your data before storing it anywhere on your device or on server. This means the data can be ready by only you or by the people chosen by you for sharing of data.

In this tutorial, I will be installing and setting up Turtl Server on Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.

Prerequisites

  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get $300 – $1200 worth in Alibaba Cloud credits for your new account. If you don't k about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  • A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  • Domain name must be pointed to your Alibaba Cloud ECS's IP address
  • Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  • Set up your server's hostname and create user with root privileges.

Setting Up Your Server

Before proceeding with installation of any kind of package, use the following command to update your Ubuntu system. To execute this command, remember to login from non-root user with sudo privileges.

# sudo apt update && sudo apt upgrade

You will need to install git on your server. To install Git execute the command below.

# sudo apt-get install git

(Optional) Execute the commands below to configure Git by providing your name and valid email address so that commit messages may contain your correct information.

# git config --global user.name "Aareez"
# git config --global user.email "xyz@example.com"

Install curl on your server.

# sudo apt-get install curl

Install libtool on your server.

# sudo apt-get install libtool

You will need to install subversion on your server. To install subversion execute the command.

# sudo apt-get install subversion

Install make on your server.

# sudo apt-get install make

Install automake on your server.

# sudo apt-get install automake

To install Libuv, you will need to download the Libuv package from its official repository.

# wget https://dist.libuv.org/dist/v1.13.0/libuv-v1.13.0.tar.gz 

Extract the files from downloaded archived directory.

# tar -xvf libuv-v1.13.0.tar.gz

Remove the downloaded archived directory.

# rm libuv-v1.13.0.tar.gz

Navigate to extracted directory using command below.

# cd libuv-v1.13.0

Execute the following commands to build, compile and install libuv.

# sudo sh autogen.sh
# sudo ./configure
# sudo make
# sudo make install
# sudo ldconfig

Install RethinkDB:

You will need to install JSON database "RethinkDB", Turtl will do settings automatically. To install RethinkDB, follow the steps below.

Add RethinkDB package in your repositories for installation by executing the following command.

# source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $xenial main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list

Verify publisher key.

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

You will need to add link to your source for adding your Ubuntu version. A text file will open, copy the text below and paste in it and save the changes.

# sudo nano /etc/apt/sources.list.d/rethinkdb.list
deb http://download.rethinkdb.com/apt xenial main

Update your system by executing the command below.

# sudo apt-get update

Execute the following command to install rethinkdb.

# sudo apt-get install rethinkdb

Rename the default.conf.sample file to default.conf

# sudo mv /etc/rethinkdb/default.conf.sample /etc/rethinkdb/default.conf

Execute the following command to restart rethinkdb.

# sudo systemctl restart rethinkdb.service

Install Clozure Common Lisp:

As Turtl is written in Common Lips, you will need to install Clozure Common Lisp. To install it, follow the steps below.

Execute the following command to install it.

# svn co http://svn.clozure.com/publicsvn/openmcl/release/1.11/linuxx86/ccl 

Execute the following commands to check if CCL has been installed successfully.

# cd ccl
# svn update

Execute the following commands to move ccl to bin, so that ccl can run from command line.

# cd ..
# sudo cp -r ccl/ /usr/local/src
# sudo cp /usr/local/src/ccl/scripts/ccl64 /usr/local/bin 

You can launch Lisp environment by executing following command.

# ccl64
# (quit) 

Install QuickLisp and ASDF:

Turtl will load its dependencies through QuickLisp and ASDF builds Lisp software. To install these, follow the steps below.

Download quicklisp by using the commands below.

# cd ~
# wget https://beta.quicklisp.org/quicklisp.lisp
# ccl64 --load quicklisp.lisp

Execute the following command to install quicklisp.

# (quicklisp-quickstart:install)

Add QuickLisp to your init file.

# (ql:add-to-init-file)

Execute the command below to quit from CCL.

# (quit) 

Download ASDF by executing command below.

# wget https://common-lisp.net/project/asdf/asdf.lisp

Execute the following commands to load and install asdf.lisp in CCL environment.

# ccl64 --load quicklisp.lisp
# (load (compile-file "asdf.lisp"))
# (quit)

Install and Configure Turtl:

Clone Turtl from Github by executing the following command.

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

Navigate to downloaded directory api and create file named launch.lisp. To do so, execute the commands below.

# cd api
# touch launch.lisp
# nano launch.lisp

Copy and paste the following text in the opened file and save the file.

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

Clone Turtl dependencies in /home/quicklisp/local-projects by executing commands below.

# cd ~/quicklisp/local-projects
# echo "https://github.com/orthecreedence/cl-hash-util https://github.com/orthecreedence/cl-async https://github.com/orthecreedence/cffi https://github.com/orthecreedence/wookie https://github.com/orthecreedence/cl-rethinkdb https://github.com/orthecreedence/cl-libuv https://github.com/orthecreedence/drakma-async https://github.com/Inaimathi/cl-cwd.git" > dependencies.txt
# for repo in `cat dependencies.txt`; do `git clone $repo`; done

Create .ccl-init.lisp by executing command below and copy-paste the following text and save the file.

# sudo nano /home/.ccl-init.lisp
(cwd "/home/turtl/api")
(load "/home/turtl/api/launch")

Create default Turtl configuration file by executing the command below.

# sudo cp api/config/config.default.lisp api/config/config.lisp

If you want to connect to your Alibaba Cloud ECS instance from a mobile or desktop client, you will need to edit the following text in configuration file. Remember to replace IP address in below text with your ECS IP address.

# sudo nano api/config/config.lisp

Execute the following command, it will automatically start Turtl server.

# ccl64

Set Up Firewalls and Ports

If you have activated firewalls, you will have to define a rule in Alibaba Cloud security group for your cloud server to add exception for port 80/tcp and 443/tcp. You can enable these ports while creating ECS instance, but in case if you have forgotten to unblock these ports, you can follow the procedure in this guide: https://www.alibabacloud.com/help/doc-detail/25471.htm

Install Turtl Client App

You will need to download Turtl Client app from its official website. It is available for Windows, macOSx, Linux and Android.

1

You will need to put your domain name or Alibaba Cloud IP address or if you are using app locally on your server, you can use localhost:8181 and create your username.

2

Your installation of Turtl on Alibaba Cloud ECS is now complete!

0 0 0
Share on

Alibaba Clouder

2,605 posts | 747 followers

You may also like

Comments