Cosmic JS Blog Stay tuned for community news, company announcements and updates from the Cosmic JS team.

How to Deploy a Website with a Custom Domain Using Cosmic JS


by Tony Spiro on June 14, 2016

Cosmic JS is a powerful CMS API that allows you to manage content for your websites and applications faster and easier.  But did you know that you can also use Cosmic JS to deploy code to your website (in any language) from any GitHub repository?  In addition to deploying content and code, starting today you can also add unlimited domains to your deployed application.  This is revolutionary because it means that moving forward all you need to launch your website is a git repository, a domain name provider and Cosmic JS!  No more hosting server necessary!  I’ve added a couple of screencasts for your viewing.  Let’s get started.

Create a Bucket

After logging in to your Cosmic JS account, create a new bucket.  After creating your new bucket, you will be prompted to install an app.

Install an App

Let's go ahead and install an app, but you could just as easily skip this step and deploy your own application pointed to your Cosmic JS bucket.  After installing your app, you will be prompted to deploy the application.

Deploy the App

Next click "Deploy Web App" to launch the web application to http://[your-bucket-slug].cosmicapp.co.  Once you do this it will take about a minute for the application to deploy on a custom instance of the Cosmic JS app server.  While this is working its magic, let's add our custom domains…

Add Custom Domains

The Cosmic app server subdomain is great for development and staging, but when you go live, you're going to want to add our own custom domains.  Cosmic JS makes this incredibly easy by providing the option to add custom domains to your deployed application.  Here are the 4 easy steps:

1. Go to Settings > Deploy Web App > Add Custom Domains (upgrade your account if needed)
2. Add your custom domains
3. Click "Set Domains"
4. Go to your domain name registrar's website and point your A Name Records to the Cosmic JS app server located at 162.243.13.186

Now navigate to your domain and notice that you now have your application hosted at your custom domain!  Add as many domains / subdomains as you need!  Whenever you need to deploy changes to the app, just push the changes up to your GitHub repository and click "Redeploy Web App".

Cosmic JS now gives you the power to deploy a website faster and more nimbly than any other system.  And all you need is a git repository, a domain name provider and Cosmic JS!

You may also like


The golden triangle of project success or failure rests on the three angles of A) Speed B) Quality C) Cost. When it comes to interactive agencies, they may be promising (at best) two of the three triangle points, but how likely are they to fulfill that promise?

Extensions are a powerful component of the Cosmic JS that allow you to create custom views in your Bucket Dashboard. We've recently made some updates to make using this feature even better.

You can now use Cosmic JS to deploy your GitHub private repos to the web.  All you have to do is sign up or sign in using your GitHub account and authorize access to your private repos. (Don't worry, we only access your private repos when you are ready to deploy them to the web).


After you authorize access the process is super easy.  Just go to Your Bucket > Settings > Deploy Web App and choose which private (or public) GitHub repo you would like to deploy. You can also deploy an app from any public Git repo url (make sure your app follows the Heroku deployment guidelines).


Click Deploy Web App and your private repo will be deployed to the world!

If you’re a developer and need to open up a new blog for yourself or a client, the idea of using Wordpress probably makes you cringe.

In this Cosmic JS Developer Spotlight, we sat down with Trey Huffine, a Software Engineer in San Francisco who currently works as a frontend engineer at Postmates. Trey is also the founder of BlockAce, gitconnected, and Radion. Check him out on Twitter or Medium, and enjoy the Q/A.

After many weeks of development we are excited to announce a couple of big updates.  We have completely rebuilt both our REST API docs and NPM module.