> ## 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.

# Railway

> One-click deployment with a button.

Deploying Medama on Railway is a simple process with a one-click deploy button.

<Info>Railway's Hobby plan is \$5 per month, plus \$0.25 per GB for persistent storage. You will receive \$5 in credits when you sign up. Typically, the base plan will be enough unless you manage large websites. You can find more details on the [pricing page](https://railway.app/pricing).</Info>

## Setup

<Steps>
  <Step title="Use Template">
    Click the button below to start configuring a template on Railway. Railway will handle the environment setup and deploy the application for you.

    [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/tjGZyt?referralCode=jiBqUQ)
  </Step>

  <Step title="Login or Sign Up">
    If you do not have an account, you will be prompted to create one. Otherwise, log in to your existing account.
  </Step>

  <Step title="Configure Deployment">
    Before you can start collecting data, you may want to configure your analytics instance to suit your needs.  It is recommended to refer to the [Environment Variables](/config/environment-variables) configuration page.

    The Railway template will automatically set the basic required environment variables for you.
  </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>
