Setting up a dedicated Nx Cloud VM

AWS EC2

  1. Login to your AWS Console and select the top image published here
  2. Launch a new instance from that AMI
  3. Recommended instance type: t3.2xlarge
  4. You will need to SSH into the instance once it's created:
  5. Networking:
    • Allow the instance to receive HTTP and HTTPS traffic
    • Allow SSH from your current IP
  6. Leave the storage options as they are
  7. "Launch instance"
  8. Wait 10 minutes, then navigate to your instance's IP in the browser. You should see the Nx Cloud dashboard!

Nx Cloud landing page

Your Nx Cloud URL

  1. At this point, your instance will have a public IP accessible from the browser.
    • You can consider this IP the URL of Nx Cloud, and proceed with the below steps and all will work fine!
  2. You might want, however, to add a Load Balancer in front of the instance, with an explicit domain (e.g. https://my-nxcloud.my-org.com).
    • This is strongly recommended because you will be able to upgrade/restart/re-configure your Nx Cloud EC2 instance while keeping the Nx Cloud URL static.
    • Create an application load balancer
    • You will need to create a certificate for your domain to assign to the LB
    • And you will need to target your EC2 instance from the LB
    • You should now have a permanent domain pointing to your Nx Cloud instance

Once you have your Nx Cloud URL proceed to the below steps!

Configuring your Nx Cloud instance

  1. Create a new myconfiguration.yaml file with the below contents
1# This is all you need to get the baseline of your nx-cloud instance configured! 2 3# Set the external URL your instance is running on. This is the URL from the previous step 4nxCloudAppURL: 'https://nx-cloud.on.my-domain.ca' # make sure no backslash is at the end 5 6secret: 7 # set your initial admin password for logging into the app 8 adminPassword: 'correcthorsebatterystaple' 9
  1. Apply the configuration:
1scp -i ./<path-to-your-ssh-pem-file>.pem -r ./myconfiguration.yaml nx-cloud@<your-instance-ip>:~/config/user/update.yaml 2

That's it! After a few minutes, you should be able to log-in with:

  • username: admin
  • password: <the-password-you-set-above>

Applying the license

Once you log-in, you will see an organisation has been created for you.

  1. You can rename it or create a new organization.
  2. Navigate to your new organization's page and send us it's id
    • It should look something like this: https://your-url.com/orgs/649f240f7fb955000c1fd10b/workspaces
  3. We will then give you a License Key which you can apply on your org's billing page

Connecting to your instance

In your Nx workspace, you can enable Nx Cloud by running:

1NX_CLOUD_API="https://nx-cloud.on.my-domain.ca" npx nx connect 2

If it doesn't work, there might be an issue with unrecognized certificates on your instance. You can try running with:

1NODE_TLS_REJECT_UNAUTHORIZED=0 NX_CLOUD_API="https://nx-cloud.on.my-domain.ca" npx nx connect 2

Although we have a full guide here for dealing with self-signed certificates.

Advanced configuration and auth

You can optionally enable authentication using your preferred SSO provider:

  • GitHub
  • Bitbucket
  • GitLab
  • SAML (Okta, Azure AD etc.)
  • And even Nx Agents
1# This is all you need to get the baseline of your nx-cloud instance configured! 2 3# only use this if you'd like to use any of the newer Nx Cloud version from here: https://nx.dev/ci/reference/release-notes#docker-containers 4# global.imageTag: '' 5 6# Set the external URL your instance is running on 7nxCloudAppURL: 'https://nx-cloud.on.my-domain.ca' # make sure no backslash is at the end 8 9# Uncomment (along with github secrets below) to enable working with GitHub pull requests or github auth 10#github: 11# auth: 12# enabled: false 13# pr: 14# apiUrl: '' # this is only needed if you have a self-hosted github instance 15 16#gitlab: 17# apiUrl: '' # this is only needed if you have a self-hosted gitlab instance 18# auth: 19# enabled: false 20 21# we do not support self-hosted bitbucket instances 22#bitbucket: 23# apiUrl: '' (if using Data Center/on-prem) 24# auth: 25# enabled: false 26 27#saml: 28# auth: 29# enabled: false 30 31# for enabling Nx Agents 32#nxCloudWorkflows: 33# enabled: true 34# externalName: your-agents-cluster-address.com 35 36# Provide plaintext values for your application to use. We will extract them, 37# store them within the application runtime, and scrub the plaintext ones from 38# the filesystem 39secret: 40 # set your initial admin password for logging into the app 41 # see here: https://nx.dev/ci/recipes/enterprise/on-premise/auth-single-admin 42 adminPassword: 'correcthorsebatterystaple' 43 44 # If you want to enable GitHub Login, just provide your client id & secret, we handle the rest 45 # see here: https://nx.dev/ci/recipes/enterprise/on-premise/auth-github 46 githubAuthClientId: 'my_client_id' 47 githubAuthClientSecret: 'my_client_secret' 48 49 # The same goes for GitLab authentication 50 # see here: https://nx.dev/ci/recipes/enterprise/on-premise/auth-gitlab 51 # gitlabAppId: 'my_gitlab_app_id' 52 # gitlabAppSecret: 'my_gitlab_app_secret' 53 54 # Bitbucket too! If these are uncommented, BB auth is automatically enabled 55 # see here: https://nx.dev/ci/recipes/enterprise/on-premise/auth-bitbucket 56 # bitbucketAppId: 'bitbucket_app_id' 57 # bitbucketAppSecret: 'bitbucket_app_secret' 58 59 # SAML auth 60 # see here: https://nx.dev/ci/recipes/enterprise/on-premise/auth-saml 61 # samlEntryPoint: 'your_saml_entry_point' 62 # samlCert: 'saml_cert' 63

Upgrades

We send out emails with every new Nx Cloud release to all our Enterprise customers:

  1. You can view your current version at the /version route: https://your-nx-cloud-url.com/version
  2. And these are the latest Nx Cloud releases

To upgrade to a newer version, add the below line to your myconfiguration.yml file:

1global: 2 imageTag: '2306.01.2' 3global: 4 imageTag: '2405.02.15' # set the version of nx-cloud you'd like 5helmVersion: '0.15.3' # helm version 6

And apply the changes:

1scp -r ./myconfiguration.yaml nx-cloud@<your-instance-ip>:~/config/user/update.yaml 2