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.
docker-compose.yml
: Configures your services (backend, frontend, database, etc.).Dockerfile
: Each application has its own Dockerfile. It define how to build the Docker image for your application.release.yml
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.WABE_ROOT_KEY
: The root key for your backend. You cange generate a ranadom secure key with the following command: openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | head -c 64
.If you want to add a new environment variable, you can add it to the .env.template
file of your application.
For example in .env.template
of the shipmysaas-back
package:
The key (before =) represent the name of the environment variable and the value (after =) is the name of the environment variable that you set on your GitHub repository.