---
created: 2026-08-06T14:49:00
tags:
  - aws
  - script
  - openwebUI
version: "1.0"
---

```
#!/usr/bin/env bash
  set -euo pipefail

  REGION="us-east-2"
  INSTANCE_ID="i-0b6c42e2ff7df81ee"

  usage() {
    echo "Usage: $0 {start|stop|status}"
    exit 1
  }

  cmd="${1:-}"
  [ -n "$cmd" ] || usage

  case "$cmd" in
    start)
      echo "Starting Open WebUI server..."
      aws ec2 start-instances --region "$REGION" --instance-ids "$INSTANCE_ID" \
        --query 'StartingInstances[].{InstanceId:InstanceId,Previous:PreviousState.Name,Current:CurrentState.Name}' \
        --output table

      echo "Waiting for instance to run..."
      aws ec2 wait instance-running --region "$REGION" --instance-ids "$INSTANCE_ID"

      echo "Waiting for status checks..."
      aws ec2 wait instance-status-ok --region "$REGION" --instance-ids "$INSTANCE_ID"

      echo "Started. Open: https://openwebui.boogerclub.com"
      ;;

    stop)
      echo "Stopping Open WebUI server..."
      aws ec2 stop-instances --region "$REGION" --instance-ids "$INSTANCE_ID" \
        --query 'StoppingInstances[].{InstanceId:InstanceId,Previous:PreviousState.Name,Current:CurrentState.Name}' \
        --output table

      echo "Waiting for instance to stop..."
      aws ec2 wait instance-stopped --region "$REGION" --instance-ids "$INSTANCE_ID"

      echo "Stopped."
      ;;

    status)
      aws ec2 describe-instances --region "$REGION" --instance-ids "$INSTANCE_ID" \
        --query 'Reservations[0].Instances[0].{InstanceId:InstanceId,State:State.Name,Type:InstanceType,PublicIp:PublicIpAddress}' \
        --output table
      ;;

    *)
      usage
      ;;
  esac 
  ```