Deploying your first project with Nitric Deploy

Nitric Deploy builds and deploys the right infrastructure from your code in your chosen cloud.

What we'll be doing

In this guide, we'll walk through the steps of getting started with Nitric Deploy. You'll deploy a new project in just a few minutes.

  1. Sign in to Nitric Deploy
  2. Create an organization
  3. Set up AWS credentials
  4. Create or import a project
  5. Create an environment
  6. Configure environment variables
  7. Deploy your project
  8. View the logs

Sign in to Nitric Deploy

Nitric Deploy is currently in preview. Request access using your GitHub account email address.

Nitric Deploy can be accessed by navigating to https://deploy.nitric.io - you'll be greeted by our sign in screens. Follow the prompts to sign in with GitHub.

Nitric Deploy sign in screen
Signing into Nitric Deploy with GitHub

Create an organization

Organizations allow you to group your projects. For example, I have an organization which contains all of my demo projects.

Let's create a new organization and give it a name.

Creating an organization in Nitric Deploy
An organization created in Nitric Deploy

Set up AWS credentials

The next step is to set up our AWS credentials with our new organization. Navigate to Settings -> Credentials and click Create Credential.

You'll need to name and store your AWS credentials.

If you're unsure about what these are or how to get them, see the Understanding and getting your AWS credentials documentation from AWS.

Only valid credentials will work here.

Adding AWS credentials in Nitric Deploy
AWS credentials created in Nitric Deploy

Create or import a project

Projects can be imported from existing Git repositories or we can scaffold a new project for you from one our of templates.

An organization in Nitric Deploy with no projects created
Import a Git repo or clone a template in Nitric Deploy

Existing projects

In order to import an existing project, it must have been scaffolded by using the Nitric CLI. Your projects must contain a valid nitric.yaml file for it to function correctly.

Configure a Nitric project from a GitHub repo

Scaffold a new project

Our template projects will give you a starting point with a basic REST API.

Your new project will be scaffolded in the repository you select.

Creating a new Nitric project

In both of the scenarios you'll need to choose a production branch. This is the branch which Nitric Deploy will watch for any push events and trigger a deployment.

You'll also need to specify which directory the Nitric source code is in - by default this would be the root directory ./ but could be a few levels deeper if you are working in an existing monorepo.


Configure environment variables

If your project requires variables, they can be added in project settings.

Changes to variables will require a redeploy, which can be triggered from the project's home.

Add environment variables for production and staging

Create an environment

An environment represents a deployed instance of your application in a specific AWS account and region. You can have one or more environments based on the development workflow you follow (e.g. dev, staging, prod), or if you need environments in other regions or using different credentials.

Once you've created an environment, Nitric Deploy will automatically initiate your first cloud deployment.

A project in Nitric Deploy with no environments created
Create a stack environment for your project

Deploy your project

Your project will automatically deploy when you create your environment for the first time, and the right cloud infrastructure will be automatically provisioned. It will also deploy each time you push to the linked branch selected when creating your environment.

Once you see the deployment tick over to success with a 'tick' you'll also notice that your preview / production URL is displayed. You can use this to access your deployed API.

If you scaffolded a template project then you can test the API out with the following command.

curl https://{url}/hello/user
A stack deployed with Nitric Deploy infrastructure automation

View the logs

By clicking on 'view latest build' we can see the details and retrieve the deployment log information.

Cloud deployment logs in Nitric Deploy

That's it! With just a few clicks, you've deployed a project to your cloud and don't have to manage environments or infrastructure state.

Whats next?

Try one of the following activities to keep going with Nitric:

  • Update your code and push to the configured branch
  • Get started on one of our guides to build a new project with the Nitric CLI
  • Join our Discord to ask questions or get help with your next project