Deploying Medama on Fly.io is a straightforward process that can be accomplished with just a few steps.

Fly.io’s Hobby plan costs $5 per month, plus $0.15 per GB for persistent storage. Typically, the base allowance on the Hobby plan is sufficient unless you manage large websites. You can find more details on the pricing page.

Setup

1

Install Fly CLI

Visit the Fly CLI installation page to install the Fly CLI on your local machine.

2

Login or Sign Up

If you don’t have an account, create one. If you already have an account, log in with your credentials.

3

Create Directory

Create a new directory on your local machine and navigate to it. For example:

mkdir medama-analytics
cd medama-analytics

This is where you will store the fly.toml configuration file.

4

Launch Application

Run the following command to deploy the application:

fly launch --from https://github.com/medama-io/example-fly-io

This command will clone the repository into the current directory and deploy the application to Fly.io. You will be prompted to configure various application settings such as the name, region, and VM size.

5

Add Your First Website

Success! You can now add your first website to the analytics instance by visiting the web interface at http://localhost:8080 or the publicly accessible hostname for your deployment.

The default login credentials are:

  • Username: admin
  • Password: CHANGE_ME_ON_FIRST_LOGIN
It is recommended to change the username and password immediately after logging in for the first time. This can be changed in the settings menu.
6

Embed Tracking Snippet

Then, embed the following HTML tracking snippet in the <head> element of your website to start collecting data:

<script defer src="https://[your-public-api-hostname].com/script.js"></script>
Learn more about configuring your tracking snippet here.
Regularly check the Medama Analytics repository for updates and redeploy the application to ensure you are using the latest version.

Was this page helpful?