Skip to content

Create server and deploy application on DigitalOcean

Notifications You must be signed in to change notification settings

explicit-logic/iaas-module-5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Module 5 - Cloud & Infrastructure as Service Basics

This repository contains a demo project created as part of my DevOps studies in the TechWorld with Nana – DevOps Bootcamp.

https://www.techworld-with-nana.com/devops-bootcamp

Demo Project: Java App Deployment on DigitalOcean

Technologies used: DigitalOcean, Linux, Java, Gradle

Project Description: This project demonstrates how to deploy a Java Gradle application to a DigitalOcean droplet using basic cloud and Linux concepts.


Deployment Steps

1. Clone the Java application repository

git clone https://gitlab.com/twn-devops-bootcamp/latest/05-cloud/java-react-example
cd java-react-example

2. Build the project

Build Project

3. Add your public SSH key to DigitalOcean

Copy your SSH key:

cat ~/.ssh/id_rsa.pub

Add it here: https://cloud.digitalocean.com/account/security

4. Create an Ubuntu Droplet

Choose a basic Ubuntu image and attach your SSH key.

Droplet

5. Connect to the droplet and install Java

ssh root@<DROPLET_IP>
apt update && apt install -y openjdk-17-jre-headless

6. Create a dedicated app user (security best practice)

adduser app
usermod -aG sudo app

7. Configure SSH access for the app user

su - app
mkdir ~/.ssh
vim ~/.ssh/authorized_keys

Paste your public SSH key into authorized_keys.

8. Deploy and run the Java application

Copy the JAR file to the droplet:

scp build/libs/java-react-example.jar app@<DROPLET_IP>:/home/app

Run the application:

ssh app@<DROPLET_IP>
java -jar java-react-example.jar

Deploy

9. Configure the firewall

Allow the following ports:

22 - SSH

7071 - Java Application

Firewall

Attach the firewall to your droplet.

10. Access the application

Open your browser and navigate to:

http://<DROPLET_IP>:7071

App

Outcome

A Java Gradle application successfully deployed and running on a DigitalOcean droplet using basic cloud infrastructure and Linux administration practices.

About

Create server and deploy application on DigitalOcean

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors