Self Hosting
Self-Hosting
Athina Self Hosting Guide
The example below is for AWS, but similar steps can be followed for other cloud providers.
Prerequisites
- Create an EC2 Instance with at least 64GB of free disk space, 16GB of RAM, and 4 CPUs. Assign a public DNS to the instance as well.
- SSH into the instance and set up the following:
- Install git
- Install Docker
- Install Docker Compose
- Install nvm and Node.js
- Install Python 3.9 and pip
- Install AWS CLI
- Install Serverless
- Obtain Athina GitHub access credentials.
- Obtain Athina ECR access credentials (AWS CLI is required).
Core Services Setup
- Clone the
athina-deploy
repository (ensure all Athina project folders are at the same directory level): - Copy
.example.env
to.env
. - Populate the respective values. Some default values and keys are provided. You can change them if needed. The DB Name can remain as it is.
- Create a Google OAuth client for Google login (Google Sign-In Documentation). Ensure you set the correct redirect URI and authorized domain (
:9000/auth/google/redirect
). - Create a bucket for data import:
- Use the bucket name specified in
.env
. Edit CORS setting of this bucket to allow the frontend to upload files:
- Use the bucket name specified in
Transactional Emails (Optional)
- We use Loops for transactional emails like user invitations, OTP sending, and downloading exported data.
- Create a free account and obtain the API key from the Loops dashboard.
- Create three transactional email templates:
- User invitation email:
- Data variables:
inviterName
andinvitedEmail
- Data variables:
- OTP email:
- Data variable:
otp
- Data variable:
- Data export email:
- Data variable:
s3_link
- Data variable:
- User invitation email:
Workers Setup (For Automated Eval)
- Clone the
athina-workers
repository: - Copy
.example.env
to.env
. - Use AWS keys with full admin access.
- Populate the respective values (refer to the
.env
file from previous steps). - Run the following command (this will take some time, ~5 minutes):
- Copy the endpoint and secret/API key from the previous command.
- Create a bucket for data export:
- Use the bucket name
export-env
. Do not block public access for the bucket.
- Use the bucket name
Services Creation
- Log in to ECR using credentials:
- Pull the required images:
- Update the
.env
file inathina-deploy
with the endpoint and API key obtained in the previous step. - Run the following command:
- Wait for all services to start.
Dashboard
- Clone the
athina-dashboard
repository:
- Copy the following to
.env
:
- Set them to the correct values.
- Run the following commands:
- Navigate to
http://<IP/DOMAIN>:3000/login
.
Updates
You can use the script.sh for starting, stopping, updating and restarting the services.
Post Installation
You can edit few configurations in the database to customize the platform. Particularly, you can set the domain in the org table. If you populate the domain column all subsequent users signing up using the same domain will be automatically be added to the same org, instead of creating a new org.