Deploy on

Create Instance

Deploy production ready Authorizer instance using with Postgres and Redis for free.


Step 1: Login to

flyctl auth login

Step 2: Create app

Create new empty directory and move to this directory:

mkdir authorizer-fly
cd authorizer-fly

Create new app instance:

flyctl launch --no-deploy

Follow the wizard to set the application name, region, etc. You will find new file named fly.toml.

Authorizer at

Step 4: Setup Postgres instance provide free tier Postgres with limited resource. Consider to use larger Posgres instance when using at production. Read more details about Postgres at Fly here.

flyctl postgres create --password <YOUR_SECURE_DATABASE_PASSWORD>

Follow the wizard just like previous command. You will be given the option to provide a name, location, and configuration. Choose Development configuration to use free instance of Postgres.

Authorizer at

To connecting the Postgres database with the app, we need to attach by using this command:

flyctl postgres attach --postgres-app <POSTGRES_APP_NAME>

Step 5: Setup Redis instance

To spin up a Redis instance, please follow this official documentation.

Step 6: Configure fly.toml file

Add this part to fly.toml file:

image = "lakhansamani/authorizer:latest"
cmd = ["./build/server", "--database_type=postgres"]
private_network = true
auto_rollback = true
PORT = "8080"

Change internal_port to 8080 inside the [[services]] section just like this:

internal_port = 8080

This is a complete example fly.toml file (don't forget to change the app value):

app = "authorizer"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
image = "lakhansamani/authorizer:latest"
cmd = ["./build/server", "--database_type=postgres"]
private_network = true
auto_rollback = true
PORT = "8080"
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
type = "connections"
hard_limit = 25
soft_limit = 20
force_https = true
handlers = ["http"]
port = 80
handlers = ["tls", "http"]
port = 443
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"

Step 7: Configure Authorizer Environment

flyctl secrets set \
ENV="production" \
DATABASE_TYPE="postgres" \

Don't forget to replace the values.

Refer to Environment Variables section to see all variables.

Step 8: Deploy

Finally, deploy the app by execute this command:

flyctl deploy

After the deployment process has been finish, check the application logs:

flyctl logs

That's all 🎉 you can start integrating Authorizer in your frontend application.

Update Instance

Since we using lakhansamani/authorizer:latest Docker image, to updating Authorizer on is easy. You only need to redeploy the app using flyctl deploy command inside the directory containing fly.toml configuration file.

Custom Domain and SSL provide custom domain configuration and free SSL using Let's Encrypt via the CLI. To setup custom domain, please refer to this documentation.