You can set up a full Spring Boot development environment (Java 17+, Maven, Spring Boot CLI, IntelliJ IDEA) on an EC2 Free Tier instance, with a few considerations to ensure it stays within the limits.

Resource                     Free Tier
EC2 Type,                    t2.micro / t3.micro (1 vCPU, 1 GB RAM)
Java 17 (Temurin),               CLI-based
Maven,                           CLI-based
Spring Boot,                     CLI-based
IntelliJ IDEA Graphical IDE      BEST BET IS LOCAL

IntelliJ on EC2: While technically possible with X11 forwarding or a remote desktop, it's not recommended on Free Tier due to performance constraints. Use IntelliJ on your local machine, and treat EC2 as the remote runtime/server.

Step-by-Step: Set Up Java Dev Environment on EC2 (Ubuntu)

1. Launch EC2 Instance (Ubuntu 22.04 preferred)

Go to AWS Console > EC2

Launch a t2.micro or t3.micro Ubuntu instance

Enable inbound ports:

22 (SSH)

8080 (Spring Boot)

Optional: 80/443 for web

2. Connect via SSH

ssh -i your-key.pem ubuntu@your-ec2-public-dns
  1. Install Java 17 (Temurin)
sudo apt update
sudo apt install -y wget gnupg curl

Adoptium Temurin is an open-source build of the Java Development Kit (JDK), supported by the Eclipse Foundation. It’s widely trusted for production use and receives regular updates and security patches.

  • Using the official APT repository ensures:
  • You get the latest stable versions of Java.
  • You can easily upgrade using apt update && apt upgrade.
  • Packages are verified and signed, ensuring security and integrity.
# Add Temurin GPG Key and Repo
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo gpg --dearmor -o /usr/share/keyrings/adoptium-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/adoptium-archive-keyring.gpg] https://packages.adoptium.net/artifactory/deb jammy main" | sudo tee /etc/apt/sources.list.d/adoptium.list

The jammy part refers to the codename for Ubuntu 22.04. If you're using another version (like 20.04 = focal), this should match.

# Install Java 17
sudo apt update
sudo apt install -y temurin-17-jdk

java -version

4. Install Maven

sudo apt install -y maven
mvn -version

5. Install Spring Boot CLI (Optional)

curl -s https://get.sdkman.io | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

sdk install springboot
spring --version

6. (Optional) IntelliJ Options

Option A: Use IntelliJ on your local machine and connect to EC2 using Git or SSH

Option B: Use VS Code Server (code-server) or JetBrains Gateway for a browser-based IDE if needed

Running a full IntelliJ GUI on EC2 Free Tier is not practical without upgraded resources or using JetBrains' remote features.

Next Steps
After the setup:

Clone or create a Spring Boot project

Use mvn spring-boot:run to launch your app

Access it via http://your-ec2-public-ip:8080