Skip to content

Create SteVe Instance in AWS Lightsail

tflaemig68 edited this page Nov 1, 2024 · 3 revisions
  1. How to create a SteVe Server using AWS Lightsail (free tier)
    1. Prepare AWS

1. Log into AWS Dashboard AWS Services -> Lightsail

2. Create Instance, Platform Linux/Unix, OS Only Ubuntu 18.04 LTS, -> Status 2024: UBUNTU 24.x Upload public key, select smallest plan -> Status 2024: Memory Minimum 1GB

![lightsail-1-create-instance](https://github.com/RWTH-i5-IDSG/steve/raw/master/website/screenshots/lightsail-1-create-instance.PNG)

3. Create Static IP address, Attach to Instance

![lightsail-2-static-ip](https://github.com/RWTH-i5-IDSG/steve/raw/master/website/screenshots/lightsail-2-static-ip.PNG)

4. Click on Instance -> Networking, Under Firewall Select + Add Another TCP 8080

![lightsail-3-firewall](https://github.com/RWTH-i5-IDSG/steve/raw/master/website/screenshots/lightsail-3-firewall.PNG)

5. Create Database, Pick MySQL 5.7.26, You can leave Username and Password to default, Plan Standard / smallest

![lightsail-4-create-database](https://github.com/RWTH-i5-IDSG/steve/raw/master/website/screenshots/lightsail-4-create-database.PNG)

6. Wait for the database to start and copy database credentials (endpoint, username and password)

![lightsail-5-check-database-status](https://github.com/RWTH-i5-IDSG/steve/raw/master/website/screenshots/lightsail-5-check-database-status.PNG)

      • ## Configure VM

1. Connect to instance via ssh using the public IP.

![lightsail-6-connect-instance](https://github.com/RWTH-i5-IDSG/steve/raw/master/website/screenshots/lightsail-6-connect-instance.PNG)

2. Update everything: `sudo apt update && sudo apt -y upgrade` (don't override the configs)

3. Install required packages:

  1. a. `sudo apt install maven`
  2. b. `sudo apt install mysql-client`
  3. c. `sudo apt-get install openjdk-17-jdk`

4. Prepare Database (use the username, host and password from earlier):

`mysql -u dbmasteruser -h ls-e98192e66a6XXXXXXXXXXXXXXXXXX.c0ftlmkcbxge.eu-central-1.rds.amazonaws.com -p`

`mysql> CREATE DATABASE stevedb CHARACTER SET utf8 COLLATE utf8_unicode_ci;`

`mysql> quit`

5. Checkout SteVe: `git clone https://github.com/RWTH-i5-IDSG/steve.git; cd steve`

6. Configure SteVe: `vi src/main/resources/config/prod/main.properties`

  • configure `db.ip`, `db.user` and `db.password` to match your MySQL information, e.g. `ls-e98192e66a6XXXXXXXXXXXXXXXXXX.c0ftlmkcbxge.eu-central-1.rds.amazonaws.com` (MySQL endpoint) as `db.ip`, `dbmasteruser` as `db.user` and `db.password` as shown.
  • Bind SteVe to all interfaces by setting: `server.host = 0.0.0.0`
  • Use a *strong* password for `auth.password`

7. Build Steve (we need to enforce lower memory usage on the tiny instance): `export MAVEN_OPTS="-Xmx200m" && mvn package`

8. Start it. I suggest running it inside screen or tmux: `java -jar target/steve.jar` You'll be able to access SteVe via the Lightsail public IP.

Clone this wiki locally