×
Back to book

Setting Up Your Development Environment: Linux

Setup instructions for setting up your local SpringBot development environment for Ubuntu 18.04.

The following steps will walk you through the process of setting up your development environment for the Ubuntu 18.04 Linux distribution.
Approximate setup time is 30-40 minutes.

For this process, we recommend The Software Development Kit Manager to manage dependencies.

SDK Man

  1. Install zip first.

    sudo apt-get install zip
  2. Install sdkman.

    curl -s "https://get.sdkman.io" | bash

    If this is successfully installed you should see the following success message.

  3. Add sdk to the path

    source "$HOME/.sdkman/bin/sdkman-init.sh"

Java

To install JDK 11 on Ubuntu 18.04, copy and paste the following into your terminal and press enter.

sdk install java 11.0.4.hs-adpt;

Depending on your Internet speed, this may take a while as packages are downloaded and installed. When the process is finished you should see something like this:

Please Note: this is the Adopt Open JDK Build.

For troubleshooting, see the Adopt OpenJDK installation instructions.

Node and Angular

  1. To install Node, copy and paste the following into your terminal and press enter:

    sudo apt-get install nodejs
  2. Run the following in your terminal to check that we have installed the correct version.

    node --version

    This will return the installed version.

      $ > node --version
      v8.10.0
  3. To install NPM, copy and paste the following into your terminal and press enter:

    sudo apt-get install npm;
  4. We now deep to configure the NPM global directory and PATH.
    Create a directory for global NPM installation in your home directory:

    mkdir ~/.npm-global

    Configure NPM to use the new directory:

    npm config set prefix '~/.npm-global'

    Add the directory to your PATH:

    echo ' export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc

    Update system variables:

    source ~/.bashrc

    You should now be able to install globally using NPM without sudo. You can read more on permissions in the NPM documentation.

  5. Update NPM by copying and pasting the following into your terminal and pressing enter:

    npm -g install npm@6.11.2;
    
    # Refresh environment 
    bash -l;
  6. Check that we have the correct version of NPM with the following command.

    npm --version

    This will return the installed version.

      $ > npm --version
      6.11.2
  7. (Optional) Install Angular CLI globally. This step is recommended for ease of use, but not strictly necessary. If you omit this step, all Angular CLI commands can be achieved by invoking the local version by prefixing all commands with npx, e.g. ng serve would become npx ng serve.
    To install, copy and past the following into your terminal and press enter:

    npm install -g @angular/cli@7.3.1

    After this has finished, running ng version should provide the following output:

PostgreSQL

SpringBot is primarily built around using the PostgreSQL database, although it can use others. In this guide, we will only walk through the setup of a PostgreSQL database.

  1. To install, copy the following into your terminal and press enter:

    yes | sudo apt-get install postgresql postgresql-client-common
  2. To create a role, copy and paste the following into your terminal and press enter:

    sudo su postgres -c "psql -c \"CREATE ROLE codebots SUPERUSER LOGIN PASSWORD 'bots' \"" ; 
  3. Create a database and assign our role to it. Copy and paste the following into your terminal and press enter:

    sudo su postgres -c "psql -c \"CREATE DATABASE "codebots"
    WITH OWNER "codebots"
    ENCODING 'UTF8'
    LC_COLLATE = 'en_US.UTF-8'
    LC_CTYPE = 'en_US.UTF-8'
    TEMPLATE template0;\"";

Gradle

Install Gradle 5.2.1 by copying and pasting the following command:

sdk install gradle 5.2.1

When this is complete you should see:


This completes the server setup required to run your SpringBot application! You can now setup your local development environment to start editing your SpringBot application, then run your application on your SpringBot server!

Source Code

Complete the SpringBot Development Environment: Source Code lesson to setup your source code in your development environment.