> ## Documentation Index
> Fetch the complete documentation index at: https://medama.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Fly.io

> Simple deployment with an easy-to-use platform.

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

<Info>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](https://fly.io/docs/about/pricing).</Info>

## Setup

<Steps>
  <Step title="Install Fly CLI">
    Visit the [Fly CLI installation page](https://fly.io/docs/flyctl/install/) to install the Fly CLI on your local machine.
  </Step>

  <Step title="Login or Sign Up">
    If you don't have an account, create one. If you already have an account, log in with your credentials.
  </Step>

  <Step title="Create Directory">
    Create a new directory on your local machine and navigate to it. For example:

    ```bash theme={null}
    mkdir medama-analytics
    cd medama-analytics
    ```

    This is where you will store the `fly.toml` configuration file.
  </Step>

  <Step title="Launch Application">
    Run the following command to deploy the application:

    ```bash theme={null}
    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.
  </Step>

  <Step title="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`

    <Warning>To successfully login, you must either use `localhost` or a `HTTPS` connection. Logging in via an unencrypted `HTTP` connection will not work. <br /><br /> If your hosting provider does not automatically provision SSL certificates to your machine, you may want to use [the automatic SSL setup feature](../deployment/ssl).</Warning>

    <Note>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.</Note>
  </Step>

  <Step title="Embed Tracking Snippet">
    Then, embed the following HTML tracking snippet in the `<head>` element of your website to start collecting data:

    ```html theme={null}
    <script defer src="https://[your-public-api-hostname].com/script.js"></script>
    ```

    <Info>Learn more about configuring your tracking snippet [here](/config/tracking-snippet).</Info>
  </Step>
</Steps>

<Tip>Regularly check the Medama Analytics repository for updates and redeploy the application to ensure you are using the latest version.</Tip>
