Tip
To deploy this project using GUI-based flow, navigate to console
- Deploy any Docker image as a web service on AWS.
- Perfect for self-hosting tools like Uptime Kuma, Plausible, Metabase, n8n, or your own Docker containers.
- Includes optional PostgreSQL database — uncomment to enable.
- This project includes a pre-configured stacktape.yml configuration. The configured infrastructure is described in the stack description section
-
AWS account. If you don't have one, create new account here.
-
Stacktape account. If you don't have one, create new account here.
-
Stacktape installed.
Install on Windows (Powershell)
iwr https://installs.stacktape.com/windows.ps1 -useb | iexInstall on Linux
curl -L https://installs.stacktape.com/linux.sh | shInstall on MacOS
curl -L https://installs.stacktape.com/macos.sh | shInstall on MacOS ARM (Apple silicon)
curl -L https://installs.stacktape.com/macos-arm.sh | shTo initialize the project, use
stacktape init --starterId dockerThe deployment will take ~5-15 minutes. Subsequent deploys will be significantly faster.
Deploy from local machine
The deployment from local machine will build and deploy the application from your system. This means you also need to have:
- Docker. To install Docker on your system, you can follow this guide.
To perform the deployment, use the following command:
stacktape deploy --projectName <<project-name>> --stage <<stage>> --region <<region>>stage is an arbitrary name of your environment (for example staging, production or dev-john)
region is the AWS region, where your stack will be deployed to. All the available regions are listed below.
projectName is the name of your project. You can create it in the console or interactively using CLI.
| Region name & Location | code |
|---|---|
| Europe (Ireland) | eu-west-1 |
| Europe (London) | eu-west-2 |
| Europe (Frankfurt) | eu-central-1 |
| Europe (Milan) | eu-south-1 |
| Europe (Paris) | eu-west-3 |
| Europe (Stockholm) | eu-north-1 |
| US East (Ohio) | us-east-2 |
| US East (N. Virginia) | us-east-1 |
| US West (N. California) | us-west-1 |
| US West (Oregon) | us-west-2 |
| Canada (Central) | ca-central-1 |
| Africa (Cape Town) | af-south-1 |
| Asia Pacific (Hong Kong) | ap-east-1 |
| Asia Pacific (Mumbai) | ap-south-1 |
| Asia Pacific (Osaka-Local) | ap-northeast-3 |
| Asia Pacific (Seoul) | ap-northeast-2 |
| Asia Pacific (Singapore) | ap-southeast-1 |
| Asia Pacific (Sydney) | ap-southeast-2 |
| Asia Pacific (Tokyo) | ap-northeast-1 |
| China (Beijing) | cn-north-1 |
| China (Ningxia) | cn-northwest-1 |
| Middle East (Bahrain) | me-south-1 |
| South America (São Paulo) | sa-east-1 |
Deploy using AWS CodeBuild pipeline
Deployment using AWS CodeBuild will build and deploy your application inside AWS CodeBuild pipeline. To perform the deployment, use
stacktape codebuild:deploy --stage <<stage>> --region <<region>> --projectName <<project-name>>stage is an arbitrary name of your environment (for example staging, production or dev-john)
region is the AWS region, where your stack will be deployed to. All the available regions are listed below.
projectName is the name of your project. You can create it in the console or interactively using CLI.
| Region name & Location | code |
|---|---|
| Europe (Ireland) | eu-west-1 |
| Europe (London) | eu-west-2 |
| Europe (Frankfurt) | eu-central-1 |
| Europe (Milan) | eu-south-1 |
| Europe (Paris) | eu-west-3 |
| Europe (Stockholm) | eu-north-1 |
| US East (Ohio) | us-east-2 |
| US East (N. Virginia) | us-east-1 |
| US West (N. California) | us-west-1 |
| US West (Oregon) | us-west-2 |
| Canada (Central) | ca-central-1 |
| Africa (Cape Town) | af-south-1 |
| Asia Pacific (Hong Kong) | ap-east-1 |
| Asia Pacific (Mumbai) | ap-south-1 |
| Asia Pacific (Osaka-Local) | ap-northeast-3 |
| Asia Pacific (Seoul) | ap-northeast-2 |
| Asia Pacific (Singapore) | ap-southeast-1 |
| Asia Pacific (Sydney) | ap-southeast-2 |
| Asia Pacific (Tokyo) | ap-northeast-1 |
| China (Beijing) | cn-north-1 |
| China (Ningxia) | cn-northwest-1 |
| Middle East (Bahrain) | me-south-1 |
| South America (São Paulo) | sa-east-1 |
Deploy using Github actions CI/CD pipeline
- If you don't have one, create a new repository at https://github.com/new
- Create Github repository secrets: https://docs.stacktape.com/user-guides/ci-cd/#2-create-github-repository-secrets
- Replace
<<stage>>and<<region>>in the .github/workflows/deploy.yml file. git init --initial-branch=maingit add .git commit -m "setup stacktape project"git remote add origin git@github.com:<<namespace-name>>/<<repo-name>>.gitgit push -u origin main- To monitor the deployment progress, navigate to your github project and select the Actions tab
stage is an arbitrary name of your environment (for example staging, production or dev-john)
region is the AWS region, where your stack will be deployed to. All the available regions are listed below.
projectName is the name of your project. You can create it in the console or interactively using CLI.
| Region name & Location | code |
|---|---|
| Europe (Ireland) | eu-west-1 |
| Europe (London) | eu-west-2 |
| Europe (Frankfurt) | eu-central-1 |
| Europe (Milan) | eu-south-1 |
| Europe (Paris) | eu-west-3 |
| Europe (Stockholm) | eu-north-1 |
| US East (Ohio) | us-east-2 |
| US East (N. Virginia) | us-east-1 |
| US West (N. California) | us-west-1 |
| US West (Oregon) | us-west-2 |
| Canada (Central) | ca-central-1 |
| Africa (Cape Town) | af-south-1 |
| Asia Pacific (Hong Kong) | ap-east-1 |
| Asia Pacific (Mumbai) | ap-south-1 |
| Asia Pacific (Osaka-Local) | ap-northeast-3 |
| Asia Pacific (Seoul) | ap-northeast-2 |
| Asia Pacific (Singapore) | ap-southeast-1 |
| Asia Pacific (Sydney) | ap-southeast-2 |
| Asia Pacific (Tokyo) | ap-northeast-1 |
| China (Beijing) | cn-north-1 |
| China (Ningxia) | cn-northwest-1 |
| Middle East (Bahrain) | me-south-1 |
| South America (São Paulo) | sa-east-1 |
Deploy using Gitlab CI pipeline
- If you don't have one, create a new repository at https://gitlab.com/projects/new
- Create Gitlab repository secrets: https://docs.stacktape.com/user-guides/ci-cd/#2-create-gitlab-repository-secrets
- replace
<<stage>>and<<region>>in the .gitlab-ci.yml file. git init --initial-branch=maingit add .git commit -m "setup stacktape project"git remote add origin git@gitlab.com:<<namespace-name>>/<<repo-name>>.gitgit push -u origin mainTo monitor the deployment progress, navigate to your gitlab project and select CI/CD->jobs
stage is an arbitrary name of your environment (for example staging, production or dev-john)
region is the AWS region, where your stack will be deployed to. All the available regions are listed below.
projectName is the name of your project. You can create it in the console or interactively using CLI.
| Region name & Location | code |
|---|---|
| Europe (Ireland) | eu-west-1 |
| Europe (London) | eu-west-2 |
| Europe (Frankfurt) | eu-central-1 |
| Europe (Milan) | eu-south-1 |
| Europe (Paris) | eu-west-3 |
| Europe (Stockholm) | eu-north-1 |
| US East (Ohio) | us-east-2 |
| US East (N. Virginia) | us-east-1 |
| US West (N. California) | us-west-1 |
| US West (Oregon) | us-west-2 |
| Canada (Central) | ca-central-1 |
| Africa (Cape Town) | af-south-1 |
| Asia Pacific (Hong Kong) | ap-east-1 |
| Asia Pacific (Mumbai) | ap-south-1 |
| Asia Pacific (Osaka-Local) | ap-northeast-3 |
| Asia Pacific (Seoul) | ap-northeast-2 |
| Asia Pacific (Singapore) | ap-southeast-1 |
| Asia Pacific (Sydney) | ap-southeast-2 |
| Asia Pacific (Tokyo) | ap-northeast-1 |
| China (Beijing) | cn-north-1 |
| China (Ningxia) | cn-northwest-1 |
| Middle East (Bahrain) | me-south-1 |
| South America (São Paulo) | sa-east-1 |
After a successful deployment, some information about the stack will be printed to the terminal (URLs of the deployed services, links to logs, metrics, etc.).
- Open the Web Service URL printed to the terminal after deploy.
- To self-host a different app, change the
imageinstacktape.ymland adjust environment variables as needed.
To run the service in the development mode (locally on your machine), you can use the dev command.
stacktape dev --region <<your-region>> --stage <<stage>> --resourceName appStacktape runs the container as closely to the deployed version as possible:
- Maps container ports to the host machine.
- Injects parameters referenced in the environment variables by
$ResourceParamand$Secretdirectives to the running container. - Injects credentials of the assumed role to the container. This means that your locally running container will have the exact same IAM permissions as the deployed version.
- Pretty-prints logs (stdout/stderr) produced by the container to the terminal.
The container is rebuilt and restarted, when you either:
- type
rs + enterto the terminal - use the
--watchoption and one of your source code files changes
-
Stacktape deployments use AWS CloudFormation under the hood. It brings a lot of guarantees and convenience, but can be slow for certain use-cases.
-
To speed up the deployment, you can use the
--hotSwapflag which avoids using Cloudformation. -
Hotswap deployments work only for source code changes (for lambda function, containers and batch jobs) and for content uploads to buckets.
-
If the update deployment is not hot-swappable, Stacktape will automatically fall back to using a Cloudformation deployment.
stacktape deploy --hotSwap --stage <<stage>> --region <<region>> --projectName <<project-name>>- If you no longer want to use your stack, you can delete it.
- Stacktape will automatically delete every infrastructure resource and deployment artifact associated with your stack.
stacktape delete --stage <<stage>> --region <<region>>Stacktape uses a simple stacktape.yml configuration file to describe infrastructure resources, packaging, deployment
pipeline and other aspects of your project.
You can deploy your project to multiple environments (stages) - for
example production, staging or dev-john. A stack is a running instance of an project. It consists of your application
code (if any) and the infrastructure resources required to run it.
The configuration for this project is described below.
- Every resource must have an arbitrary, alphanumeric name (A-z0-9).
- Stacktape resources consist of multiple underlying AWS or 3rd party resources.
The app resource runs any public Docker image as a managed
web service using the prebuilt-image packaging type — no
Dockerfile needed.
To self-host a different tool, swap the image property:
resources:
app:
type: web-service
properties:
packaging:
type: prebuilt-image
properties:
# Change this to any Docker image:
# plausible/analytics:v2.1
# metabase/metabase:latest
# n8nio/n8n:latest
image: louislam/uptime-kuma:1Resource allocation is configured with resources. Increase these values for heavier workloads:
resources:
cpu: 0.5
memory: 1024Pass runtime configuration to your container using environment. Adjust these to match the image you are deploying:
environment:
- name: UPTIME_KUMA_PORT
value: "3000"A relational database section is included but commented
out. Uncomment it to provision a managed PostgreSQL instance and connect it to the web service using connectTo:
# database:
# type: relational-database
# properties:
# credentials:
# masterUserPassword: $Secret('db-password', 'my_secret_password')
# engine:
# type: postgres
# properties:
# version: '16.6'
# primaryInstance:
# instanceSize: db.t3.microWhen uncommented, also uncomment the connectTo section on the web service so it can reach the database. Connection
details (host, port, credentials) are automatically injected as environment variables.