# Hosting

# The Following Steps For Hosting The Backend And The Frontend!

# Step 1: Adding The SSH Key in Digital Ocean Teams.

  • Visit Digital Ocean and log in.

  • After logging in, the dashboard will be displayed where all the droplets on which the database, the backend and the frontend are hosted. For accessing these, first, an SSH key will be required to be set up and then adding the SSH key to the existing team. Before adding an SSH key to the droplet, the should be generated via OpenSSH on Mac or Linux or Putty on Windows.

    • If there are no existing SSH keys, generate one by following the steps in the link

    • After generating or having an existing key, add the key to the team by following the steps,

      • Navigate to the EHIPortal project (Should be on the left-hand side of the page)
      • In the left pane, click Settings
      • Then click the Security tab at the top of the page
      • Click on Add SSH Key button
      • Paste the public key in the SSH key content box. On the right, instructions are provided for more help.
      • Add a name for the SSH key.
    • After adding the SSH key, to access the droplets check out the below link. The instructions for macOS, Linux and Windows are all provided in the below link.

# At this point, you can now access the droplets from the terminal.

# Step 2: Accessing The Backend Droplet

  • For starting and stopping the backend server,
    • In the current directory, just execute ./start.sh. The backend server has started.
    • For stopping the server, the command ps ax shows all the background processes, our backend server would be named java -jar /root/project/ehiportal-backend.jar**. On the extreme left, the number is the pid (Process ID), copy that pid.
    • After copying the pid, execute the command kill the_pid_number

# At this point, the backend server is stopped.