Question

Fullstack Architecture Deployments Recomendations

My Apps Structures

  1. Backend: Express js, and sensitive .env file
  2. Frontend: React, vite, and shadcn
  3. MySQL

I need to set the apps to public facing soon, but Im newbie about the deployment and preparations Could you help me to prepare or give me the recomendations for my fullstack architecture, give the cost effective if possible

I got some exprienced for deploy using pm2 and reverse proxy from my old vps server, and some docker and container knowledgements


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
April 29, 2025
Accepted Answer

Heya,

Here is a rough plan on how you can proceed with yoru setup:

  • 1 DigitalOcean Droplet (smallest $6/month plan or $8 if you want better CPU performance)

  • Inside the droplet:

    • Dockerized environment (separate containers for backend, frontend, and MySQL)

    • Reverse proxy (NGINX or Traefik) for HTTPS (SSL with Let’s Encrypt)

    • Volume for MySQL data persistence (so you don’t lose DB data on container restart)

General Steps to Set it Up

1. Create a DigitalOcean Droplet

  • Ubuntu 24.04

  • Pick 1vCPU, 1GB RAM, 25GB SSD (the cheapest one)

  • Add SSH keys for secure login.

2. Initial Server Setup

  • Update packages (sudo apt update && sudo apt upgrade)

  • Set up basic firewall (UFW) to allow only SSH, HTTP, and HTTPS.

  • Install Docker + Docker Compose.

3. Project Structure (on Server)

/app
  /backend (your Express app)
  /frontend (your React app built with Vite)
  /mysql-data (Docker volume for MySQL data)
  docker-compose.yml
  nginx.conf

Prepare Your Apps

  • Backend: Make a Dockerfile to run Express.js

  • Frontend: Build your React app (npm run build) → serve static files with Nginx or a Node server.

  • Database: Use a MySQL Docker image (official one is fine).

  • Environment Variables: Use a .env file (but never commit it publicly).

5. Set up Docker Compose

  • One service for backend

  • One for frontend (optional if you use Nginx directly)

  • One for MySQL

  • One for Nginx as reverse proxy

  • Use Docker volumes for MySQL persistence.

6. SSL Certificate

  • Set up Let’s Encrypt SSL easily using:

    • Certbot (with NGINX)

    • OR Traefik (which auto-manages certificates)

7. Domain Setup

  • Point your domain DNS to your Droplet IP.

  • Configure NGINX to serve frontend at / and backend API at /api/.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.