---
layout: default
navsection: installguide
title: Install the API server
...
h2. Prerequisites:
# A GNU/Linux (virtual) machine
# A domain name for your api server
h2(#dependencies). Install dependencies
~$ sudo apt-get install \
bison build-essential gettext libcurl3 libcurl3-gnutls \
libcurl4-openssl-dev libpcre3-dev libpq-dev libreadline-dev \
libsqlite3-dev libssl-dev libxslt1.1 postgresql sqlite3 sudo \
wget zlib1g-dev
mkdir -p ~/src
cd ~/src
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar xzf ruby-2.1.2.tar.gz
cd ruby-2.1.2
./configure
make
sudo make install
sudo gem install bundler
~$ cd $HOME # (or wherever you want to install)
~$ git clone https://github.com/curoverse/arvados.git
~$ cd arvados/services/api
~/arvados/services/api$ bundle install
~/arvados/services/api$ cp -i config/application.yml.example config/application.yml
~/arvados/services/api$ sudo mkdir -p /var/cache/git
~/arvados/services/api$ sudo git clone --bare ../../.git /var/cache/git/arvados.git
~/arvados/services/api$ rake secret
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
secret_token: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
~/arvados/services/api$ ruby -e 'puts rand(2**128).to_s(36)'
6gqa1vu492idd7yca9tfandj3
~/arvados/services/api$ sudo -u postgres createuser --createdb --encrypted --pwprompt arvados
[sudo] password for you: yourpassword
Enter password for new role: paste-password-you-generated
Enter it again: paste-password-again
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
~/arvados/services/api$ cp -i config/database.yml.sample config/database.yml
~/arvados/services/api$ edit config/database.yml
~/arvados/services/api$ RAILS_ENV=development bundle exec rake db:setup
~/arvados/services/api$ cp -i config/initializers/omniauth.rb.example config/initializers/omniauth.rb
APP_ID = 'local_docker_installation'
APP_SECRET = 'yohbai4eecohshoo1Yoot7tea9zoca9Eiz3Tajahweo9eePaeshaegh9meiye2ph'
CUSTOM_PROVIDER_URL = 'https://auth.curoverse.com'
You can also run your own SSO server. However, the SSO server codebase currently uses OpenID 2.0 to talk to Google's authentication service. Google has deprecated that protocol. This means that new clients will not be allowed to talk to Google's authentication services anymore over OpenID 2.0, and they will phase out the use of OpenID 2.0 completely in the coming monts. We are working on upgrading the SSO server codebase to a newer protocol. That work should be complete by the end of November 2014. In the mean time, anyone is free to use the existing Curoverse SSO server for any local Arvados installation.
~/arvados/services/api$ bundle exec rails server --port=3030
PassengerBufferResponse off
https://localhost:3030/login
~/arvados/services/api$ bundle exec rails console
irb(main):001:0> Thread.current[:user] = User.all.select(&:identity_url).last
irb(main):002:0> Thread.current[:user].is_admin = true
irb(main):003:0> Thread.current[:user].update_attributes is_admin: true, is_active: true
irb(main):004:0> User.where(is_admin: true).collect &:email
=> ["root", "your_address@example.com"]