Follow these steps to deploy the Memory Lane backend to your t4g.small instance.
In the AWS Console, ensure your Security Group has the following Inbound Rules:
| Protocol | Port Range | Source | Reason |
|---|---|---|---|
| TCP | 22 | Your IP | SSH Access |
| TCP | 4000 | 0.0.0.0/0 | Node Backend (Direct) |
| TCP | 80 | 0.0.0.0/0 | HTTP (for Nginx/Frontend) |
| TCP | 443 | 0.0.0.0/0 | HTTPS |
Before the app can store memories, you must create these 4 tables in the DynamoDB Console.
Go to DynamoDB > Tables > Create table and repeat for each:
- Table name:
IdentityCore- Partition key:
pk(String) - Sort key:
sk(String)
- Partition key:
- Table name:
MemoryChunks- Partition key:
pk(String) - Sort key:
sk(String)
- Partition key:
- Table name:
TokenIndex- Partition key:
pk(String) - Sort key:
sk(String)
- Partition key:
- Table name:
ReviewQueue- Partition key:
pk(String) - Sort key: (Leave empty)
- Partition key:
- IAM Role: Create a role for EC2 with
AmazonDynamoDBFullAccess. - Attach: Go to your instance > Actions > Security > Modify IAM role and attach the new role.
The updated script now supports both Ubuntu and Amazon Linux.
# SSH into EC2, then:
curl -o deploy.sh https://raw.githubusercontent.com/AlphaTechini/Memory-Lane/main/deploy.sh
chmod +x deploy.sh
./deploy.shCreate a .env file in the project directories on your server.
Location: ~/Memory-Lane/backend/.env
PORT=4000
MONGODB_URL=your_atlas_uri (optional if using Dynamo)
GROQ_API_KEY=your_key
RAG_ENGINE_URL=http://localhost:8081
JWT_SECRET=your_secret
FRONTEND_URL=your_frontend_url (e.g., https://memorylane.cyberpunk.work)
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
EMAIL_FROM=[email protected]
RESEND_API_KEY=your_resend_keyLocation: ~/memory-lane/rag-engine/.env
STORAGE_BACKEND=dynamodb
AWS_REGION=eu-north-1 # Replace with your instance region
PORT=8081pm2 status- See running services.pm2 logs- See real-time logs.pm2 restart all- Restart after env changes.