Skip to main content

Quickstart

This is a quick Nebari CLI reference. If you're new to Nebari, start at Installing Nebari.

A diagram showing the different Nebari CLI commands. The first step is 'nebari init' which creates the 'nebari-config.yaml' file. The second step is 'nebari deploy' which deploys the Nebari instance on the cloud. The third step is 'nebari destroy' which destroys the deployed instance. These second and third steps run 'nebari validate' and 'nebari render' internally. 'nebari validate' verifies the 'nebari-config.yaml' file. 'nebari render' generates the 8-stage terraform deployment scripts.

Install

You need a MacOS or Linux machine with Python >= 3.8 to install Nebari.

You can install Nebari from PyPI or conda-forge:

conda install nebari -c conda-forge

Verify the installation with:

nebari --help
Make sure it displays an output similar to:
usage: nebari [-h] [-v]
{deploy,render,init,validate,destroy,support,upgrade,keycloak,cost-estimate}
...

Nebari command line

positional arguments:
{deploy,render,init,validate,destroy,support,upgrade,keycloak,cost-estimate}
Nebari - 0.4.3

optional arguments:
-h, --help show this help message and exit
-v, --version Nebari version number

Initialize

After installation, you can create a new Nebari project!

Create a new project directory:

mkdir <project-name>
cd <project-name>

Create the nebari-config.yaml file using the guided init wizard:

nebari init --guided-init

Or, if you know the initialization requirements and have set up the environment variables, you can directly run the nebari init command with the necessary flags.

⚠️Project naming conventions

In order to successfully deploy Nebari, there are some project naming conventions which need to be followed. Below we summarize the format requirements for the most common cloud providers:

  • Letters from A to Z (upper and lower case) and numbers are allowed;
  • Special characters are NOT allowed;
  • Maximum accepted length of the name string is 16 characters;
  • If using AWS names SHOULD NOT start with the string aws.

Each cloud provider has its own naming conventions which in some cases may be more restrictive or less restrictive than the ones listed above. For more information, refer to the Initializing Nebari section in the "How to Deploy ..." documentation for your chosen cloud provider.

Download the service account key file for your Nebari project, and set the following environment variables:

export GOOGLE_CREDENTIALS="path/to/JSON/file/with/credentials"
export PROJECT_ID="Project ID"

Create nebari-config.yaml with:

nebari init gcp --project projectname \
--domain domain \
--auth-provider password

Deploy

You can deploy your Nebari instance to the cloud (selected in the previous step) with:

nebari deploy -c nebari-config.yaml

You may need to set up necessary DNS records (with a DNS provider of your choice) for your chosen domain to proceed if you see:

Take IP Address 12.312.312.312 and update DNS to point to "your.domain" [Press Enter when Complete]

It can take up to 30 mins for the deploy command to execute.

Destroy

To delete all your Nebari resources, while preserving the nebari-config.yaml file, run:

nebari destroy -c nebari-config.yaml

It can take up to 30 mins for the destroy command to complete.

💡tip

If you deployed Nebari on the cloud, verify if the relevant resources were destroyed and manually delete anything that was not destroyed.

Validate (optional)

After creating the nebari-config.yaml file, you can customize it. To ensure your customizations are valid, run:

nebari validate -c nebari-config.yaml
ℹ️note

This command is automatically run when you deploy.

Render (optional)

You can generate the (Terraform) deployment workflow scripts with:

nebari render -c nebari-config.yaml

This is useful if you use a GitOps workflow with GitHub (or GitLab) Actions.

ℹ️note

This command is automatically run when you deploy.


If you face any issues with the commands, check out the Troubleshooting guide.