This guide walks you through setting up, containerizing, and deploying a NestJS application on Akash Network.
1. Build a NestJS App
Follow these steps to create and prepare your NestJS app:
Step 1.1: Create a New NestJS App
- Ensure Node.js and npm are installed on your system.
- Run the following commands:
- Navigate into the project:
Step 1.2: Configure Your Application
- Install any additional packages your app needs (e.g.,
npm install --save <package>
). - Update the application logic in the appropriate directories (e.g.,
src/
).
2. Containerize the App
To deploy the app on Akash, you need to containerize it using Docker
.
Step 2.1: Create a Dockerfile
In the root of your NestJS app, create a Dockerfile:
Step 2.2: Build and Test the Image
- Build the Docker image:
- Run the image locally to test:
- Visit
http://localhost:3000
to confirm your app works.
3. Deploy to Akash
Akash supports deployments via its CLI or Web Console. Below, you’ll find instructions for both, along with a sample deploy.yaml
file.
Step 3.1: Prepare the Deployment File
Akash deployments require an SDL file (deploy.yaml). Below is a sample based template:
Replace my-nestjs-app
with the name of your image in a public Docker registry (e.g., Docker Hub).
Step 3.2: Deploy Using Akash CLI
- Install Akash CLI by following Akash CLI Installation Guideenticate your wallet by following Wallet Authentication .
- Deploy
deploy.yaml
using the commands below:
Detailed CLI deployment instructions are available here.
Step 3.3: Deploy Using Akash Web Console
If you prefer a GUI, use the Akash Console.
- Access the console at console.akash.network.
- Login with your wallet.
- Follow the Console Deployment Guide to upload your
deploy.yaml
file to complete the process.
4. Monitor and Access Your App
After deployment: