2026-04-08
Deploy your Spring Boot application to AWS Lightsail server
Always test your application locally with production profiles before deploying
SPRING_PROFILES_ACTIVE=prod# application-prod.properties
spring.datasource.url=jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_NAME}
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}
# Production optimizations
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.show-sql=false
# Logging
logging.file.name=/var/log/myapp/application.logsudo systemctl status myapp.servicesudo tail -f /var/log/myapp/application.logcurl http://localhost:8080/actuator/healthsudo netstat -tlnp | grep :8080Open port 8080 in Lightsail console → Networking tab
sudo systemctl status myapp.servicesudo journalctl -u myapp.service -ffree -h (memory usage)df -h (disk usage)free -hConfigure Nginx reverse proxy for HTTP/HTTPS traffic on standard ports