Deploying Your First Node App
What you’ll need
Before you can deploy your app please check you have the following:
- A Cloud 66 Account — If you don’t already have one Sign up for a free Cloud 66 account. You’ll get free unlimited access to all products for 4 weeks.
- A Git Repo containing your application code — This can be a public or private repo. You can use any Git provider like GitHub / BitBucket or use your own privately hosted repo.
- A Cloud Account or Your Own Servers — See below.
An account with your cloud provider of choice. Cloud 66 supports AWS, Google Cloud, Microsoft Azure, DigitalOcean, Hetzner, Linode,Maxihost, OVH, Packet, Rackspace,
Vultr, and Cloud A.
Click on any of the links above for instructions on linking your cloud provider to your Cloud 66 account.
Registered servers are a great way for operations teams to manage and allocate physical server resources for consumption by dev teams. Registered servers are a pool of your own servers (on a private or public cloud) that can be used for any application and configuration. For more information on how to add your own registered servers, we recommend this tutorial.
Accessing your Git Repo
The first thing we need is access to your code, so that we can build and deploy it for you.
The easiest option is to give us (read-only) access to a GitHub repo. To do this:
- Click Get Started
- On the next page click Link with Github
- We’ll send you to our app on Github (you’ll need to sign in)
- Once you’re signed in, click Configure & then select the account you wish to link to Cloud 66
- Install and authorize our Github app (you can restrict our access to specific repos if needed)
- You will be redirected back to your Cloud 66 dashboard and you can move on to Step 2.
Public Github Repositories
If your code is in a public GitHub repository then you can add it using its public link without installing our GitHub app. To do so, follow the instructions under the Other git repos tab (above).
Using a non-Github host
If you’d prefer to use another git host, or your own self-hosted repository:
- Click I’d rather enter a git repo URL.
- Click View SSH key
- Open your repo and add the key to its settings (usually found under SSH or SSH keys)
- Come back to Cloud 66 and click the green Next… button
Make sure your git repository accepts connections on port 22, from Cloud 66 public IP addresses: 188.8.131.52 184.108.40.206 220.127.116.11 18.104.22.168 22.214.171.124 126.96.36.199 188.8.131.52 184.108.40.206 220.127.116.11 18.104.22.168 22.214.171.124 126.96.36.199
Defining your application
Now that we have access to your code, we can set up your application:
- Choose the repo you want to deploy and set the branch
- Choose an environment for your application
- Give your application a name (this will be used to label your application throughout the Cloud 66 dashboard, and will not be visible to public users.)
- Click Analyze
Hang tight, the results will be displayed in a few seconds…
Configuring your application
Once the analysis is complete you’ll see a yellow Information Box that you can use to verify the analysis is correct.
If there are any problems you can make changes and click Reanalyze my code. If necessary, you can also Add Environment Variables.
You can configure many aspects of your Stack using the Toolbelt or a manifest file.
Choosing a deployment target
If you’re deploying for the first time you need to add your Cloud provider credentials:
Amazon Web Services
- AWS Access key ID — You get this info from your AWS account Dashboard. (more help)
- AWS Secret Access Key — You get this info from your AWS account dashboard, when you create your AWS account. (more help)
- Give this cloud key a name — This is to give you the option of deploying to multiple AWS accounts. If you are deploying to a single account only, you can leave it as default.
- Give this cloud key a name — this is to give you the option of deploying to multiple accounts with the same cloud provider. If you only have 1 account you can leave it as default.
- Click Add Cloud — this will redirect you to the DigitalOcean dashboard. You'll need to login to DigitalOcean to finish adding the key.
Google Compute Engine
- GCE Client Email — You get this info from your GCE account Dashboard. Under Service Accounts → API's → Credentials (more help)
- GCE Project Id — You get this info from your GCE Dashboard. It's located at the top of the Overview page. (more help)
- GCE Key — This is a JSON file you need to upload, you get this from your GCE Dashboard.
- Hetzner API key — You can find this under Access → API tokens → Generate API Token (more help)
- Give this cloud key a name — this is to give you the option of deploying to multiple Linode different Linode accounts. If you only have one account you can leave it as default.
- Linode API Key — You get this information from your Linode Cloud Dashboard. my profile → API Keys tab.
- Maxihost API Key — You can find this under Settings & Billing → API Keys → Create API key (more help)
- Azure Subscription ID — You get this info from your Azure cloud Dashboard. (more help)
- Client ID — You get this info from your Azure Dashboard.
- Client Secret — You get this info from your Azure Dashboard.
- Tenant ID — You get this info from your Azure Dashboard.
- API region — You need to specify which API region your project uses
- OVH Project ID — You can find this on your OVH project dashboard (more help)
- Packet API Key — You get this info from your Packet Cloud Dashboard.
- Rackspace Username — You get this info from your Rackspace Cloud Dashboard.
- Rackspace API Key — You get this info from your Rackspace Cloud Dashboard. (more help)
- Rackspace user base — Select either UK or US.
Your Own Servers
- Registered Servers — First you need to Register your server as a deployment target with Cloud 66. Click on the Add Registered Servers link. You can also navigate to the Registered Servers page under Account Settings.
- Copy & run the command — Run the provided command in the terminal on your server. Once this has successfully completed you can then approve the server and it will become available as a Cloud 66 deployment target.
Finalizing deployment details
Now you can decide how you want to configure your frontend (web) and Database Servers.
They can be shared or deployed to separate servers.
Deploying to Production
For production environments we always recommend separate servers. If you need fine grained control for more advanced deployments you can use a manifest file.
That’s it! Now just click Deploy.
Server build states
In order to allow you to start working with your new app as soon as possible, there are two build states (or stages) for application servers:
- Ready - server is available to use, with the minimum required configuration
- Optimized - all the latest packages are installed & optimized
Servers will automatically progress from “ready” to “optimized”.