Setup via EC2 Instance
Last updated
Last updated
This guide will help understand how to install a PlayAI Node on EC2 instance. This guide is divided into 5 major steps, all parts are descriptive and have video and image content to help you user and make this process more clear.
Prerequisites: - AWS
This is first step one, create security group with the following inbound outbound rules, which we’ll discuss details in steps
Steps ->
Go to Security groups by any of the following way
AWS Console → Services → EC2 → Security Groups ( Left panel )
Link: Here
Then follow the guide in images, which allow inbound and outbound traffic for your instance
Inbound Traffic
SSH (Port 22): Needed for secure connection.
HTTP (Port 80): For web access.
HTTPS (Port 443): For secure web access.
Outbound traffic
SSH (Port 22)
Steps ->
Go to EC2 Dashboard:
In the top search bar, type EC2 and click on EC2 Dashboard.
Launch an EC2 Instance:
Click on Launch Instance.
Name Your Instance: Enter a name like PlayAI-Server
.
Select an Amazon Machine Image (AMI): Choose Ubuntu Server 24.04 LTS (64-bit x86).
Instance Type: Choose t3.medium
or t2.medium
or any other that have greater or equal 4 GB RAM, which is minimum resource requirements to run PlayAI Node
Key Pair: If you don’t have one, create a new key pair and download it. This will let you connect to the server securely. You can choose to ignore it if you are not accessing it from local machine. In EC2 you can connect to terminal without Key Pair. But you’ll definitely need it if you are accessing from your local machine or some other machine.
Security Group Settings: Select existing security group which you created in previous step
Storage: Set the storage size to 20GB (or more if you think you'll need it).
Go to EC2 Dashboard:
Once all settings are in place, click Launch Instance. It will take a minute or two to start.
This step will help you connect to ec2 instance, in other word, it gives you terminal to run all the commands for setting up PlayAI node
AWS provides a way to connect to your instance directly from your browser without needing to download any software.
Steps ->
Go to Your Instance:
Once your instance is running (you'll see it in the Instances list), select it.
Connect to the Instance:
Click Connect at the top of the page.
Select the EC2 Instance Connect option (this lets you connect via your browser). There are two option available, keep default if you don’t know which one to choose.
Click Connect — a new window will open with a terminal.
You’ll see a terminal there, run below command to see everything is fine upto now
In this step, we’ll work on installing required software for smoothly running PlayAI node. Which is installing docker, docker-compose, git. Follow step by step to avoid trouble
Steps ->
Update the Server:
Run the following command to make sure everything is up to date, this will update some basic setting and add some linux channel and all, nothing specific to our setting
Install Docker:
This step would install docker, which is needed to run AI engines provided by PlayAI. Run below command to install
Install Docker Compose:
Docker compose is a way to run multi container setup in a managed way, which help us define configurations and mount volumes and much more. Install Docker Compose with this command:
Verify Docker and Docker Compose are Installed:
Check Docker version by running:
Check Docker Compose version by running:
Now all the dependency part is sorted and we are moving towards the steps to run a PlayAI node. Below is step by steps guide to run a node, which include downloading repo from PlayAI official github page. Make sure to keep node specific values ready that you’ll need in step 5, refer to step 5 for these values.
Steps ->
Start to work as root user to avoid sudo all the time, for that you just have to run sudo -i
Clone the PlayAI Node Client repository using
Navigate to the cloned directory using
Create and Configure .env
add your wallet address, signer key, main server address, and node token ID.
Run below command to open file in write mode and paste and setup the below variables then press CTRL + X
then Y
and then Enter
to save this file
Pulling latest Node Client Containers, you’ll see some logs in the terminal, that confirms that you’re pulling latest container. This step is required to pull latest container, even if you are not setting it first time and you want to pull latest updates just run below command
Now we have container ready, start the node in detached mode using
Check if the node is running using docker ps
. Expect to see the node container listed
Sample output from running this command
Shutting down all services ( Do not use CTRL+C or Command+C to shut down nodes )
To see live logs run below command ( optional ). This will show live logs of what’s happening with node, it will show some requests are coming and something is saving back to our database and all. Which confirm finally that your node is health and running and getting computations requests from our backends
For closing live logs press ctrl + C
. Don’t use ctrl + c
to shut down the node service, use docker-compose down only which will remove some of the unnecessary files from last and you’ll have fresh node live whenever you start node again.