Deploy a Java Application on Linux
As a cloud engineer you will deploy a variety of applications on different types of servers in the cloud. Learn how to deploy a SpringBoot Java application on a AWS Lightsail Linux VPS.
Module 1: Clone and compile the application
Module 2: Create an S3 bucket and upload files
Step 1: Open the AWS Console and choose Lightsail
Module 3: Deploy an Amazon Linux Server
Step 1: Deploy a VPS AWS Linux Server
Step 2: Choose the instance image
Step 3: Configure the VPS with a shell script
Module 4: Configure networking
Step 1: Delete the Amazon Linux server
- How to deploy and configure a Linux server on AWS Lightsail.
- Configure and deploy a Java SpringBoot application with a launch script or User data.
- Configure the VPS network with a static IP and open a port for the Java application
About | |
---|---|
✅ AWS Level | 200 - Intermediate |
⏱ Time to complete | 45 minutes |
💰 Cost to complete | Free when using the AWS Free Tier or USD 1.01 |
🧩 Prerequisites | - An AWS account: If you don't already have an account, follow the Setting Up Your Environment tutorial. For a quick overview for creating account follow the Create Your AWS Account instructions. - AWS credentials: Follow the instructions in Access Your Security Credentials to get your AWS credentials - A git client: Follow the instructions to Install Git for your operating system. - Java installed locally. - Maven installed locally. - Java installed locally. - Maven installed locally. |
💻 Code Sample | GitHub |
📢 Feedback | Any feedback, issues, or just a 👍 / 👎 ? |
⏰ Last Updated | 2023-05-31 |
.jar
file.target
directory, and create a HelloBuilder.jar
file.Steps 1-2 are optional if you completed the Deploy an ASP.NET Core Application on Windows Server with AWS Lightsail tutorial.
my-practical-cloud-guide
. Please note that S3 bucket names are globally unique, so make sure to pick a name that is available. For the rest of this tutorial, when you see <my>-practical-cloud-guide
for the S3 bucket name, please replace it with your bucket name. Select Create Bucket.<my>-practical-cloud-guide
bucket, choose Objects.HelloBuilder.jar
from the ./practical-cloud-guide-code/run-to-build /linux-app-deploy/target/
and choose Open.hellobuilder.service
file to your S3 bucket. This file congifures the application as a service and will restart the application after a reboot. Select the file and choose Open.- Select Linux/Unix for a platform.
- For a Blueprint, choose OS Only.
- Choose Amazon Linux 2
Amazon_Linux_2_Java
. Choose Create instance to instantiate the VPS.port 22
and port 80
are open by default. The Java application is running but available on port 8080. In this module, you will configure networking to open port 8080
and add a static IP address.port 22
and port 80
.8080
as a port. Select Create.8080
added to the firewall.Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.