ShipMySaaS provides a fully automated deployment system to quickly deploy your application to your preferred VPS. With Docker, Docker Compose, and a GitHub Action included, deploying your SaaS is streamlined and efficient, saving you valuable time.
Connect to your VPS as the root user.
Change the SSH port on your VPS:
#Port 22
and change it to your preferred port (e.g., Port 51011
). Remove the #
at the beginning of the line to uncomment it.Ctrl+X
, then Y
to confirm, and Enter
to save).Create a non-root user (example: shipmysaas
):
Install Docker (for Ubuntu):
a. Set up Docker's repository:
b. Add Docker's repository to Apt sources:
c. Install Docker:
Add the non-root user to the Docker group:
Initialize Docker Swarm and create a network:
Create the directory /run/secrets/shipmysaas
and set proper permissions:
Create an SSH key for password-less connection in the release action:
Copy the public SSH key to your VPS:
Copy the private key to your GitHub repository as the VPS_SSH_KEY
secret.
The deployment files are located in the root of the project:
docker-compose.yml
: Configures your services (backend, frontend, database, etc.).Dockerfile
: Builds the Docker image for your application.Release
GitHub Action: Automates the deployment process.This setup enables you to deploy your application in just a few minutes.
To deploy your application:
release
GitHub Action.The GitHub Action will handle the entire process, from building the application to deploying it on your VPS.
To ensure a successful deployment, you must set the following environment variables in your GitHub repository:
CLOUDFLARE_TOKEN
: If your domains are managed via Cloudflare. (Adjustments to docker-compose.yml
are needed if using another reverse proxy like Traefik.)MONGO_URL
: The connection URL for your production MongoDB database.RESEND_SECRET_KEY
: For email integration with Resend.STRIPE_SECRET_KEY
: For payment processing with Stripe.VPS_SSH_KEY
: The private SSH key to connect to your VPS.