--- layout: default navsection: installguide title: Install the API server navorder: 1 ... # API server setup ## Prerequisites: 1. A GNU/Linux (virtual) machine 2. A domain name for your api server 3. Ruby >= 2.0.0 4. Bundler ## Download the source tree git clone https://github.com/curoverse/arvados.git See also: [Downloading the source code](https://arvados.org/projects/arvados/wiki/Download) on the Arvados wiki. ## Configure the API server First install the gems: cd arvados/services/api bundle install Next, configure the database: cp -i config/database.yml.sample config/database.yml Edit `database.yml` to your liking and make sure the database and db user exist. Then set up the database: RAILS_ENV=production rake db:setup Then set up omniauth: cp -i config/initializers/omniauth.rb.example config/initializers/omniauth.rb Edit `config/initializers/omniauth.rb`. Choose an *APP_SECRET* and *APP_ID*. Also set *CUSTOM_PROVIDER_URL*. Make sure your Omniauth provider knows about your *APP_ID* and *APP_SECRET* combination. You also need to update `config/initializers/secret_token.rb`. Generate a new secret with rake secret and put it in `config/initializers/secret_token.rb`: Server::Application.config.secret_token = 'your-new-secret-here' Edit the main configuration: cp -i config/config.yml.example config/config.yml First, you want to make sure that uuid_prefix is set to a unique 5-character alphanumeric string. An example is given that generates a 5-character string based on a hash of your hostname. The `uuid_prefix` is a unique identifier for your API server. It also serves as the first part of the hostname for your API server, for instance {{ site.arvados_api_host }} For a development site, use your own domain instead of arvadosapi.com. You will also want to change `compute_node_nameservers` to suit your environment. Consult `config.defaults.yml` for a full list of configuration options. Always put your local configuration in `config.yml` instead of editing `config.defaults.yml`. ## Apache/Passenger Set up Apache and Passenger. Point them to the services/api directory in the source tree. To enable streaming so users can monitor crunch jobs in real time, add to your Apache configuration: PassengerBufferResponse off ## Add an admin user Point browser to the API endpoint. Log in with a google account. In the rails console: Thread.current[:user] = User.find(1) Thread.current[:user].is_admin = true User.find(1).update_attributes is_admin: true, is_active: true User.find(1).is_admin This should be => true ## Create a token In rails console a = ApiClient.new(owner_uuid:'0'); a.save! x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1); x.save; x.api_token