Prerequisites for Deploying Spring Boot Apps to AWS Lightsail

Setting Up Your Development Environment

Spring Boot Deployment Course

Prerequisites Overview

What We’ll Cover Today

Accounts & Services

  • AWS Account setup
  • Domain registration options

Development Environment

  • Java JDK requirements
  • Build tools (Maven/Gradle)
  • IDE recommendations

Command Line Tools

  • SSH client setup
  • Git version control
  • AWS CLI (optional)

Knowledge Prerequisites

  • Spring Boot fundamentals
  • Basic Linux commands
  • Network concepts

Required Accounts and Services

AWS Account Setup

Steps to get started:

  1. Visit https://aws.amazon.com
  2. Click “Create an AWS Account”
  3. Complete registration process
  4. Add payment information (required)

AWS Logo

Free Tier Benefits:

  • 750 hours/month for first 12 months
  • Perfect for learning and testing

Domain Registration (Optional)

Recommended Domain Registrars:

  • AWS Route 53 (integrated with AWS services)
  • Namecheap (popular and affordable)
  • GoDaddy (widely recognized)
  • Cloudflare (includes CDN benefits)

Why register a domain?

  • Professional appearance
  • Easier to remember than IP addresses
  • SSL certificate setup is simpler

Development Environment Setup

Java Development Kit (JDK)

Requirements: JDK 17 or later

# Check your current Java version
java -version
javac -version

Installation Options:

  • Oracle JDK: Commercial support available
  • OpenJDK: Open source, free to use
  • Package Managers: Easy installation and updates

Build Tools: Maven vs Gradle

Maven

# Check installation
mvn -version
  • XML-based configuration
  • Extensive plugin ecosystem
  • Spring Boot’s default choice

Gradle

# Check installation
gradle -version
  • Groovy/Kotlin DSL
  • Faster build performance
  • Flexible configuration

Choose one based on your team’s preference

IDE Recommendations

Top Spring Boot IDEs:

  • IntelliJ IDEA - Excellent Spring Boot integration
  • Visual Studio Code - Lightweight with Java extensions
  • Eclipse + Spring Tools Suite - Free and powerful
  • Spring Tool Suite (STS) - Purpose-built for Spring

Key Features to Look For:

  • Spring Boot run configurations
  • Application property auto-completion
  • Built-in Maven/Gradle support

Command Line Tools

SSH Client Setup

Windows:

  • Built-in OpenSSH (Windows 10+)
  • PuTTY (traditional option)
  • Windows Subsystem for Linux

macOS/Linux:

  • Built-in OpenSSH client

Test SSH availability:

ssh -V

You’ll use SSH to:

  • Connect to Lightsail instances
  • Deploy applications
  • Monitor server performance

Git Version Control

Essential for project management:

# Check Git installation
git --version

# Basic Git workflow you'll use
git add .
git commit -m "Deploy ready"
git push origin main

Installation:

  • Windows: Download from git-scm.com
  • macOS: Homebrew or Xcode Command Line Tools
  • Linux: Package manager (apt install git)

Spring Boot Knowledge Prerequisites

Core Spring Boot Concepts

Essential understanding:

  • Spring Boot Starters: Dependency management made easy
  • Application Properties: Environment-specific configurations
  • Profiles: Different settings for dev/prod environments
  • Auto-configuration: Spring Boot’s “magic” explained
  • Embedded Servers: Tomcat, Jetty, Undertow options

Core Spring Boot Concepts

Configuration Example:

# application-prod.yml
server:
  port: 8080
spring:
  profiles:
    active: prod

Database and REST Knowledge

Database Integration:

  • Spring Data JPA basics
  • JDBC connection configuration
  • Database migration tools (Flyway/Liquibase)
@Entity
public class User {
    @Id
    @GeneratedValue
    private Long id;
    private String name;
}

RESTful Services:

  • @RestController usage
  • HTTP methods (GET, POST, PUT, DELETE)
  • JSON serialization with Jackson
@RestController
public class UserController {
    @GetMapping("/users")
    public List<User> getUsers() {
        return userService.findAll();
    }
}

Linux and Server Administration Basics

Essential Linux Commands

File and Directory Operations:

ls -la          # List files with details
cd /path/to/dir # Change directory  
mkdir app-logs  # Create directory
rm -rf old-app  # Remove files/directories

File Viewing and Editing:

cat application.log     # View file contents
tail -f application.log # Follow log files
nano config.properties # Edit files

Process Management:

ps aux | grep java     # Find Java processes
sudo systemctl start myapp  # Start services

File Permissions and Services

File Permissions:

# Make file executable
chmod +x deploy.sh

# Change ownership
sudo chown app:app myapp.jar

# Common permission patterns
chmod 755 # rwxr-xr-x
chmod 644 # rw-r--r--

Service Management:

# Service operations
sudo systemctl start myapp
sudo systemctl enable myapp  
sudo systemctl status myapp
sudo systemctl restart myapp

Network and Security Basics

Understanding Ports and Firewalls

Common Ports You’ll Use:

Service Port Purpose
HTTP 80 Web traffic
HTTPS 443 Secure web traffic
SSH 22 Server access
Spring Boot 8080 Default application port
MySQL 3306 Database connections

Firewall Concepts:

  • Inbound vs. Outbound rules
  • Port ranges and protocols
  • Source IP restrictions

Pre-Deployment Checklist

Verify Your Setup

Complete this checklist before proceeding:

  • Test Command:bash java -version && mvn -version && git --version && ssh -V

Sample Application Ready

Don’t have a Spring Boot app?

We’ll provide a sample application that includes:

  • REST endpoints for testing
  • Database integration examples
  • Production-ready configuration
  • Health check endpoints
  • Logging configuration

Quick Test:

./mvnw spring-boot:run
# Visit http://localhost:8080

Summary and Next Steps

Key Takeaways

Essential Requirements:

  • AWS account for cloud resources
  • Java development environment
  • Command line tool proficiency
  • Basic Spring Boot knowledge

Success Factors:

  • Understanding of Linux basics
  • Network and security concepts
  • Version control with Git
  • Service management principles

You’re Ready When: All checklist items are complete and you can run a Spring Boot application locally

What’s Coming Next

Our Deployment Journey:

  1. Application Configuration - Setting up profiles and properties
  2. Lightsail Instance Creation - Provisioning your server
  3. Server Environment Setup - Installing Java and dependencies
  4. Application Deployment - Getting your app running
  5. Production Optimization - SSL, monitoring, and scaling

Ready to Deploy? Let’s build something amazing! 🚀