These are a collection of scripts to provision resources in an Amazon Web Services account.
-
Install Docker Desktop for your OS: https://www.docker.com/products/docker-desktop/
-
Clone this repository to a directory on your computer.
-
In a command-line shell, build the Docker image:
docker compose build aws-cli
-
Copy
example.env
to.env
-
Run and enter the resulting image:
docker compose run --rm aws-cli bash -l
- Install aws-cli and its dependencies: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
-
Sign up for an AWS account (note a credit card will be required): https://aws.amazon.com/
-
The root credentials used to sign up should be saved in a secure password manager and used sparingly. Create a new user for yourself in the IAM console, give it Administrator privileges, and generate an Access Key ID and Secret Access Key.
-
Configure these in the AWS client under "Long-term credentials" along with your desired default region: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html
-
(Optional) If you have multiple AWS accounts, created named profiles for each, and set in
.env
if using Docker or set AWS_PROFILE in your shell environment otherwise: https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html
The Dokku script launches an EC2 instance running a Debian AMI and installs Dokku with Postgres and LetsEncrypt plug-ins.
Run ./dokku
and follow the prompts to enter an application name, domain, email address for SSL cert registration, and instance type.
After completing successfully, the script will store an SSH key in ~/.ssh
to be used to log in to the new instance.
ssh -i ~/.ssh/dokku-[App name]-key-pair.pem admin@[Domain or/IP address of instance]
Configure the DNS records for your domain to point to the new IP address of the instance to use a domain name address.
Note: it may take up to 20 minutes to complete the post-launch installation and setup of Dokku, if it performs SSL parameter prime number generation. You can monitor the post-launch setup by logging in as above, then watching the log with: tail -f /var/log/cloud-init-output.log
The default instance type recommended by the script is t3a.small, which will cost about $14/mo. Note that Heroku buildbacks may not yet be supported by ARM64 processors.