As a large hosting provider, Amazon has a number of different methods for storing your website or app. One popular protocol is S3, which can be connected to using a number of popular drag-and-drop clients for Mac and Windows, as well as Amazon's own CLI client. However, doing so to update your site requires a lot of manual work, especially if you're regularly making updates.
A service such as DeployHQ saves time and helps to eliminate such problems by streamlining the process. You can set up a repository and a server to be deployed to automatically when a push is received in your repository host, or manually via a couple of clicks in the DeployHQ interface.
If you're not already using Git, we have a number of recommended resources you can look at, in particular the excellent set of guides on Git's main website. For a broader overview, see our beginner's guide to website deployment tools.
For the purpose of this guide, we'll assume you already have a Git-based workflow in place for managing changes to your code.
Creating a New Project in DeployHQ
Once you've signed up for a new DeployHQ account, you can click the New Project button at the top of the screen to get started.
You'll be happy to hear that we have a generous free plan that lets you deploy 1 project up to 10 times a day!
Enter a name for your project and choose where your repository is hosted. You can connect to a repository on any of the main hosting providers — GitHub, GitLab, Bitbucket, and Codebase — but if you host a repository elsewhere you can configure it manually.
Connecting to Your Repository
Once you've clicked Create Project you'll be prompted to login to the repository host, then you can choose your account, after which you'll be presented with a list of repositories that you have access to.
Select the repository, then DeployHQ will automatically connect to it and add an SSH public key to be able to access it. It's recommended that you keep the add a webhook
option checked, as that will allow us to set up automatic deployments later in this guide.
Configuring Your S3 Bucket
Once you've connected to your repository, you'll be automatically directed to the New Server screen. Here, you'll be able to enter a name for your server, then choose S3 as the protocol.
Next, enter the following details:
- Bucket Name: The name of your S3 bucket
- Access Key ID: Your AWS access key
- Secret Access Key: Your AWS secret key
- Path Prefix: The directory that files will be placed in on the bucket (e.g.,
htdocsorpublic_html)
Once those details have been added, simply click Create Server to finish.
Deploying for the First Time
Now that we've configured our repository and server, we can run our first deployment. Click the Deploy for the first time link at the top right of your project.
You can check the information before clicking the green Deploy button at the bottom right. You'll notice that the chosen server and branch are selected automatically, and the start revision says The very first commit. This is because no previous commits have been deployed. The end revision will be automatically selected as the latest found in the chosen branch.
Once you've clicked the Deploy button, the deployment will start. In this instance the process will be simple — all files will be transferred to your deployment directory.
Once that's done, you can review the log and see a full list of which files were transferred across.
Setting Up Automatic Deployments
After your first deployment, you can push a new commit to your repository and see the changes uploaded automatically. To enable this, head to the Automatic Deployments page on the left hand side, then enable the option next to your server.
After pushing a test commit, the deployment starts automatically and only the files changed in that commit are uploaded. For example:
2025-01-31 15:12:30 0 index.html
2025-01-31 15:12:30 0 styles.css
2025-01-31 15:12:30 0 app.js
That's it! We've now improved our deployment process massively by setting up automatic deployments using DeployHQ. We no longer have to upload everything at once or worry about missing anything — only files that have changed will be uploaded.
To learn more about when automatic deployments are a good fit, check out our guide on Git auto-deployment: when it's a game-changer and when it's a gamble.
Configuring Custom Request Headers
When deploying to S3, you may want to set custom request headers for cache control, content encoding, or other metadata. DeployHQ lets you configure headers using glob patterns to target specific file types.
Common examples:
| Pattern | Header | Value |
|---|---|---|
*.html |
Cache-Control |
max-age=3600 |
*.css, *.js |
Cache-Control |
max-age=31536000, immutable |
*.gz |
Content-Encoding |
gzip |
You can configure these in your server settings under Request Headers. For more details, see our support documentation on custom S3 request headers.
Deploying to S3-Compatible Object Storage
Amazon S3 isn't the only option. DeployHQ now supports deploying to any S3-compatible object storage provider, giving you the flexibility to choose the storage solution that best fits your needs and budget.
Supported Providers
| Provider | Endpoint Format |
|---|---|
| Cloudflare R2 | https://<ACCOUNT_ID>.r2.cloudflarestorage.com |
| Wasabi | https://s3.<REGION>.wasabisys.com |
| Backblaze B2 | https://s3.<REGION>.backblazeb2.com |
| DigitalOcean Spaces | https://<REGION>.digitaloceanspaces.com |
| MinIO | https://<SERVER>:<PORT> (self-hosted) |
| Katapult | https://<REGION>.object-storage.katapult.io |
How to Configure S3-Compatible Storage
Setting up an S3-compatible server follows the same process as Amazon S3, with one additional field:
- Create a new server in your project
- Choose S3-Compatible as the protocol
- Enter your Endpoint URL (provider-specific, see table above)
- Enter your Bucket Name, Access Key ID, and Secret Access Key
- Optionally set a Path Prefix for subdirectory deployments
That's all there is to it. DeployHQ handles the rest, including incremental file transfers and automatic deployments — exactly the same as with Amazon S3.
For full configuration details and provider-specific setup instructions, see our S3-compatible storage documentation.
If you're deciding between Amazon S3 and Cloudflare R2, our in-depth comparison of AWS S3 vs. Cloudflare R2 can help you choose the right option.
Related Resources
- How to Implement Server Backups with AWS S3 — Protect your deployments with automated backups
- Deploying Applications to AWS ECS/EKS Using DeployHQ — For containerized workloads on AWS
- Building a CI/CD Pipeline from Scratch with DeployHQ — Complete pipeline guide
Have questions about deploying to S3 or S3-compatible storage? Reach out to us at support@deployhq.com or connect with us on Twitter.