Setting up a personal Domain with Zeit Now
Tags: serverless, zeit, godaddy, devops
Published: 2019-09-17 10:31:25

---
title: Setting up a personal Domain with Zeit Now
published: true
description: It is a personal blog post where I set up a personal Domain in Zeit.co
tags: #serverless,#zeit,#godaddy,#devops
---
## Introduction

I started to work on my internet appearance and just bought a domain on [GoDaddy](https://godaddy.com). Of course, I could host my application on there too but why should I when there are Serverless services like [Surge.sh](https://surge.sh) or [Zeit.co](https://zeit.co/). 
I chose Zeit because I already did some prototyping with it and I like the Github-integration as well as their dashboard.

## Why Serverless?

Serverless does not mean "no servers". Of course, a server must be involved for serving the code. It just means care **less** about servers and reduces maintenance overhead.
It comes handy if you want to deploy something quick without `ssh`-ing to setup a webserver like **Nginx** or **Apache Webserver** or put your files via (S)FTP and then maintaining it.
With Serverless you don't need all this.
Awesome!!

## Zeit Now

**Zeit**'s Now got my attention, when I was looking for Serverless-Provider.

> ZEIT Now is a cloud platform for static sites and serverless functions. 
> It enables developers to host websites and web services that deploy instantly, scale automatically, and requires no supervision, all with no configuration.

That's the quote from the [Zeit.co](https://zeit.co/docs/)'s landing page.
Again Awesome!!
You first need to login to its dashboard. I chose to login via my Github-account and then you need to install the CLI.

`npm i -g now`

After that you login to your account:

`now login`

Now (hehe) you put your credentials. After that you will need to verify your login via E-Mail by clicking on the button there. Finally, you are good to go...that's what I thought.

In my case, I needed to setup a `now.json` and put it into my project.

## Deployment Configuration with Now

The reason behind that, I had a [NuxtJS](https://nuxtjs.org/)-project and Now needs to know what type of application you want to deploy.

From the [Deployment Configuration](https://zeit.co/docs/v2/advanced/configuration/), I took
* Name = string name for the deployment.
* Version = [Now Platform Version](https://zeit.co/docs/v2/advanced/platform/overview/#versioning)

In the end my `now.json` looks like this

```
{
    "name": "jolo-portfolio",
    "version": 2
}
```

Now (hehe) it's usable... That's what I thought again but for a Nuxt-Project you need to adjust the `nuxt.config.js` and change the output directory

```
{
  ...
  "generate": {
    "dir": "public"
  }
}
```
and the `package.json`

```
{
  "scripts": {
    ...
    "build": "nuxt generate"
  }
}
```

Now (😋) you should be able to deploy your project and that's the outcome after using `now`-command

```
➜ now
> Deploying /my/projects/portfolio under jolo
> Using project jolo-portfolio
> Synced 1 file (29.33KB) [924ms]
> https://jolo-portfolio-31bvou1kk.now.sh [v2] [1s]
> Ready! Deployed to https://jolo-portfolio.jolo.now.sh [in clipboard] [1m]
```

You will get a Unique Deployment URL (1st URL above) and a staging URL (2nd URL above) with SSL(**!!!**) 

Pretty Awesome!

## Point to a Custom Domain

Cool, for a quick prototype and a feeling how your page looks in production, you want to have a personal URL. So I googled for a domain and found one on [GoDaddy](godaddy.com).

There is a nice [blog post](https://zeit.co/guides/setup-godaddy-domain-now/) about how to setup the domain with Zeit Now.

`now domains add <domain>`

You will see now something like

![Now Domains Command](https://thepracticaldev.s3.amazonaws.com/i/52cpdhbc8c1xu37e1281.png)

It says that the domain is pointing to GoDaddy. Now we need to change it to Zeit by changing the Nameserver on GoDaddy.

![GoDaddy Dashboard](https://thepracticaldev.s3.amazonaws.com/i/7r8xi322322ociqxtxsl.png)
and click on **DNS**.

In the **Nameserver**-area, you first add the **TXT** by copying it from the CLI. 

![TXT Records](https://thepracticaldev.s3.amazonaws.com/i/o1i89s539xcarhbroaob.png)

Otherwise, a downtime will be needed in order to point to your Domain from Zeit.

And then you change the **server type** to **custom**, add the Nameservers which is giving from the output of the CLI (see above) to your DNS of your GoDaddy-domain.

![Nameserver](https://thepracticaldev.s3.amazonaws.com/i/s4ta79wd9ig22rtvsioz.png)

In my case, 
* a.zeit-world.co.uk
* d.zeit-world.org
* e.zeit-world.com
* f.zeit-world.net

Now back to your terminal, you run following command
`now domains verify <domain>``

It can happen that you will need to wait until it points to your domain.
But once it's setup, you'll see following message

![Now Domain Verify](https://thepracticaldev.s3.amazonaws.com/i/dl27ywmzeka9xtwt7lvk.png)

Super Awesome!

## Aliasing

Zeit Now can dedicate your deployment and also sets up a SSL-certificate.
It's time to put the alias to your `now.json` which looks in my case like this

```
{
    "name": "jolo-portfolio",
    "version": 2,
    "alias": "jolodev.guru"
}
```

Now, I can deploy my page to production by using 
`now --prod`

How Awesome is that?

## Conclusion

There is a setup process for Serverless and tbh it will take a while.
However, once it is all setup you can deploy an application by running just a single command and the setup itself is way less than setting up an own webserver.

Zeit is an awesome provider and Now an awesome tool where you can play around with it for free **!!**
I like its style and the blog posts. Definitely, worth to check them out.

If you are interested what I had been rolled out, check out my page:
https://jolodev.guru/

Have you noticed that I typed *Now* 23 times 😆

Remember: JoLo - Just OverLOad!

## References

* https://zeit.co/
* https://zeit.co/guides/deploying-nuxtjs-with-zeit-now/
* https://zeit.co/guides/setup-godaddy-domain-now/
* https://godaddy.com/
* https://de.godaddy.com/help/fugen-sie-einen-txt-datensatz-19232?lang=en