Skip to content

AWS EC2

Mitchell edited this page Apr 29, 2020 · 18 revisions

Running Statping on the smallest EC2 server is very quick using the AWS AMI Image. The AWS AMI Image will automatically start a Statping Docker container that will automatically update to the latest version. Once the EC2 is booted, you can go to the Public DNS domain to view the Statping installation page. The Statping root folder is located at: /statping on the server.

AMI Image

Choose the correct AMI Image ID based on your AWS region.

  • us-east-1 ami-09ccd23d9c7afba61 (Virginia)
  • us-east-2 ami-0c6c9b714a501cdb3 (Ohio)
  • us-west-1 ami-02159cc1fc701a77e (California)
  • us-west-2 ami-007c6990949f5ccee (Oregon)
  • eu-central-1 ami-06e252d6d8b0c2f1f (Frankfurt)

Upgrading Statping

You can upgrade the Statping executable by running the commands below on your EC2 instance.

VERSION=$(curl -s "https://github.com/statping/statping/releases/latest" | grep -o 'tag/[v.0-9]*' | awk -F/ '{print $2}')
wget https://github.com/statping/statping/releases/download/$VERSION/statping-linux-x64.tar.gz
tar -xvzf statping-linux-x64.tar.gz
chmod +x statping
mv statping /usr/local/bin/statping

You can test the version number by running statping version.

Instructions

1. Create an EC2 instance from AMI Image

Go to the main EC2 dashboard and click 'Launch Instance'. Then type Statping inside the search field for 'Community AMI'. Once you've found it in your region, click Select!

2. Get the Public DNS for EC2 Instance

Copy the 'Public DNS' URL and paste it into your browser.

3. Setup Statping

Use SQLite if you don't want to connect to a remote MySQL or Postgres database.

EC2 Server Features

Running your Statping server on a small EC2 instance is perfect for most users. Below you'll find some commands to get up and running in seconds.

  • Super cheap on the t2.nano (~$4.60 monthly)
  • Small usage, 8gb of hard drive
  • Automatic SSL certificate if you require it
  • Automatic reboot when the server needs it
  • Automatic database cleanup, so you'll never be at 100% full.
  • Automatic docker containers/images removal

Create Security Groups

Using the AWS CLI you can copy and paste the commands below to auto create everything for you. The server opens port 80 and 443.

aws ec2 create-security-group --group-name StatpingPublicHTTP --description "Statping HTTP Server on port 80 and 443"
# will response back a Group ID. Copy ID and use it for --group-id below.
GROUPS=sg-7e8b830f
aws ec2 authorize-security-group-ingress --group-id $GROUPS --protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id $GROUPS --protocol tcp --port 443 --cidr 0.0.0.0/0

Create EC2 without SSL

Once your server has started, go to the EC2 Public DNS endpoint. You should be redirected to /setup to continue your installation process! The database information is already inputed for you.

GROUPS=sg-7e8b830f
KEY=MYKEYHERE
AMI_IMAGE=ami-7be8a103

aws ec2 run-instances \
    --image-id $AMI_IMAGE \
    --count 1 --instance-type t2.nano \
    --key-name $KEY \
    --security-group-ids $GROUPS

EC2 Server Specs

  • t2.nano ($4.60 monthly)
  • 8gb SSD Memory
  • 0.5gb RAM
  • Docker with Docker Compose installed
  • Running Statping, NGINX, and Postgres
  • boot scripts to automatically clean unused containers.
Clone this wiki locally