Installing AuthMachine on AWS
This document describes various options for installing and using AuthMachine on Amazon AWS platform.
AuthMachine requires the following services:
- PostgreSQL database
By default these services are installed by the AuthMachine installer (
curl get.authmachine.com | sudo bash - ), but if you use Amazon AWS you might consider using Amazon RDS and Amazon Elasticache services instead.
Launch an EC2 instance for AuthMachine application server. Ensure that you can log in using SSH. Install docker and docker-compose. Also while it's not required, you can install
redis-cli utilities for testing connectivity with RDS and Elasticache. (For ubuntu run:
apt-get install postegrsql-client redis-tools).
Setting up Elasticache
Create a Redis instance in your AWS Elasticache console. Ensure that you can connect to it from EC2 instance. Check AWS docs for more details.
Setting up Docker
Log in to your EC2 instance using SSH. Ensure that your current user is authorized to run docker commands (usually either root or a member of the "docker" group) Create a directory to store AuthMachine configuration files:
mkdir -p ~/authmachine
Run the following helper script:
curl get.authmachine.com/setup-nginx-aws.sh | bash -
Download the example docker-compose.yml file from here
curl get.authmachine.com/docker-compose-aws.yml -o docker-compose.yml
docker-compose.yml file in your favourite text editor and adjust the following variables there:
Adjust other variables as per your liking. Note, that AUTHMACHINE_SECRET_KEY and AUTHMACHINE_SECRET_TOKEN should be random 32-characters strings unique per installation.