A simple web application to manage AWS EC2 instances and save money on remote development or VPS costs.
Running EC2 instances 24/7 on AWS can be expensive. This tool helps you save money by making it easy to:
- Start your VPS only when you need to use it
- Stop your VPS when you're not using it
- Track your usage hours and costs
Instead of paying for 720+ hours per month (24/7 operation), you only pay for the hours you actually use.
- Simple Dashboard: View all your EC2 instances at a glance
- One-Click Control: Start and stop instances with a single click
- Cost Tracking:
- Monthly usage hours and costs (from AWS Cost Explorer)
- Hourly pricing rates (automatically fetched from AWS Pricing API)
- Multi-Platform Support: Automatically detects and prices Linux and Windows instances correctly
- Secure: Password-protected with server-side authentication
Note on Real-Time Session Tracking: AWS EC2 does not provide an API to track when an instance was last started. The
LaunchTimefield represents when the instance was originally created, not when it was last started after a stop. Therefore, accurate real-time session cost tracking is not currently supported by AWS infrastructure.
- Node.js (v18 or higher)
- AWS Account with EC2 instances
- AWS IAM credentials with the following permissions:
ec2:DescribeInstancesec2:StartInstancesec2:StopInstancesce:GetCostAndUsagepricing:GetProducts
- Clone the repository:
git clone <your-repo-url>
cd aws-instance-management- Install dependencies:
npm install- Create a
.envfile in the root directory:
# Authentication Password
AUTH_PASSWORD=your-secure-password
# Session Secret (change this to a random string)
SESSION_SECRET=your-random-secret-key
# AWS Credentials
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=ap-southeast-1- Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:5173
To create a production build:
npm run buildPreview the production build:
npm run preview- Login: Enter your password to access the dashboard
- View Instances: See all your EC2 instances with their current status
- Control: Click "Start" or "Stop" to manage your instances
- Monitor Costs:
- Monthly Hours/Cost: Historical data from AWS Cost Explorer (24-48h delay)
- Hourly Rate: Accurate pricing from AWS Pricing API
If you use a t3.medium instance ($0.0416/hour in Singapore):
- 24/7 Operation: 720 hours/month = $29.95/month
- 8 Hours/Day: 240 hours/month = $9.98/month
- Savings: $19.97/month (67% reduction)
- Frontend: SvelteKit with Tailwind CSS
- Backend: SvelteKit API routes
- AWS SDK:
@aws-sdk/client-ec2- Instance management@aws-sdk/client-cost-explorer- Monthly billing data@aws-sdk/client-pricing- Accurate hourly rates
- All AWS operations are performed server-side
- Session authentication using HTTP-only cookies
- No AWS credentials exposed to the client
- Password stored in environment variable
MIT
