# Connecting a domain to Cloudflare

To complete this step you first need to create an account on the website <https://dash.cloudflare.com/login>.

**Why connect a domain to Cloudflare?**

* Faster website loading.
* Protection tools against hackers and DDoS attacks.
* Free SSL certificate (your site will be available via https\://)

If in the previous step you bought the domain at a Cloudflare registrar - you can safely skip this step. But if the domain was purchased at any other registrar (Namecheap, GoDaddy or another) - follow the instructions below:

Registering with Cloudflare

If the domain has not been purchased yet, buy it first (for example, via Namecheap) and make sure you have access to the registrar account.

1. Go to the website <https://www.cloudflare.com/>
2. To log in/register click the Log In button

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FHCJLZDoCSYeFwH2Hg7im%252Fimage.png%3Falt%3Dmedia%26token%3D30244a66-a339-4734-8948-46bb8686e853&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ca1397ee&#x26;sv=2" alt=""><figcaption></figcaption></figure>
3. If you don't have a Cloudflare account yet, click the Sign Up link below to register.

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FHnUPQQwNThnxadFNCD0I%252Fimage.png%3Falt%3Dmedia%26token%3D08b5c0d1-743e-4dc1-8f7e-67a2c7cb4a38&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=7a120f93&#x26;sv=2" alt=""><figcaption></figcaption></figure>
4. In the registration form that opens, enter your email address and a strong password for the account. After filling in all fields click the **Sign Up** button to register.

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252Fzanbdd5Ug7xBsES2pfGx%252Fimage.png%3Falt%3Dmedia%26token%3D787a6204-558f-4345-a506-2f204c649167&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=7ba584db&#x26;sv=2" alt=""><figcaption></figcaption></figure>
5. After completing registration an email from Cloudflare will be sent to the address you provided. Open it and click the Verify your email button to confirm the account.

Adding a domain to Cloudflare

1. To add a domain to Cloudflare click the + Add -> Connect a domain button

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FXzRN0IGOwQC8sLOukFsK%252Fimage.png%3Falt%3Dmedia%26token%3D51772605-034b-499f-af7b-3cd83d84385b&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=c6eb2c4e&#x26;sv=2" alt=""><figcaption></figcaption></figure>
2. Paste your domain into the field as shown in the screenshot below.

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FTI2xLDF60uFEFiMbyzVi%252Fimage.png%3Falt%3Dmedia%26token%3Dfbfbbde2-1b74-4377-9c2a-657611d7fb4c&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=d9a65b61&#x26;sv=2" alt=""><figcaption></figcaption></figure>

   And then click the Continue button below

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FY0I3OkN1R1EG0kZLGjsB%252Fimage.png%3Falt%3Dmedia%26token%3D823a73d7-39cb-4805-96e6-0c077b2b72a2&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=80e55b35&#x26;sv=2" alt=""><figcaption></figcaption></figure>
3. Cloudflare will prompt you to choose a pricing plan. The Free plan is suitable for basic connection. Click Select Plan.

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FVedggssDo9gp4aw9wex0%252Fimage.png%3Falt%3Dmedia%26token%3Dcc3f6ad0-9040-43e0-b352-ba1a7f3f7621&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=389e6b2a&#x26;sv=2" alt=""><figcaption></figcaption></figure>
4. After selecting a plan a window will open to check DNS records. Cloudflare will automatically import all existing DNS records for your domain. You can select all records and delete them.

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FmBWBCazfn8oWp92zkVui%252Fimage.png%3Falt%3Dmedia%26token%3D45318523-749b-42c0-bdad-539f802cf6f9&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=fd3ebd83&#x26;sv=2" alt=""><figcaption></figcaption></figure>

   After clicking the Delete button a modal window will appear for confirmation. Type Delete in the field as shown in the screenshot below and click the Delete button

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FAm2iVHOzYJHS0zNp4h0s%252Fimage.png%3Falt%3Dmedia%26token%3D2d28b99c-8cf4-43e7-adbf-90a8afce4112&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b12d6bff&#x26;sv=2" alt=""><figcaption></figcaption></figure>
5. After deleting unnecessary DNS records click the Continue to activation button to proceed to the next setup step.

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FpxwT7bSVu2oZoC8pWJxQ%252Fimage.png%3Falt%3Dmedia%26token%3Df4a38248-f502-4e96-b736-ee5409d418be&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=1f3164a7&#x26;sv=2" alt=""><figcaption></figcaption></figure>
6. Confirm the message “Without DNS records, Cloudflare is unable to activate your site. It’s best if you set up your DNS records now.” and proceed to the next step.

   <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FkjJjUHwcPgvpRb130HPL%252Fimage.png%3Falt%3Dmedia%26token%3D8c79434c-1c30-4c6f-8931-35d8ad4b7c67&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=2fa298aa&#x26;sv=2" alt=""><figcaption></figcaption></figure>
7. Next Cloudflare will show the new NS servers (Nameservers), for example: **alice.ns.cloudflare.com** [**bob.ns.cloudflare.com**](http://bob.ns.cloudflare.com/) Go to your registrar account (in our case the Namecheap account) <https://www.namecheap.com/>

Then hover over your nickname in the top left corner. In the modal window that appears select the **Dashboard**.

<figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FGoBQLp8yGlr1JNFiLHLV%252Fimage.png%3Falt%3Dmedia%26token%3D219b8cce-f40b-42cd-a17f-227a3f5cfaff&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=c8ddd1cf&#x26;sv=2" alt=""><figcaption></figcaption></figure>

On the opened page a list of your domains will be displayed. Find the desired domain and click the **Manage**.

<figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FFBvVFFUu0COcj6LOp1Dg%252Fimage.png%3Falt%3Dmedia%26token%3D9b6564a5-1f87-4543-9ccf-9cae4ed17b9c&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=92b5f233&#x26;sv=2" alt=""><figcaption></figcaption></figure>

You will go to the domain management page. Find the Nameservers section, click the dropdown and choose the Custom DNS option. After that two fields will appear - enter the Cloudflare NS servers provided to you in them:

<figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FTh9Gb5jVgykXQKyZOor9%252Fimage.png%3Falt%3Dmedia%26token%3D045e4619-083b-4be4-9e91-c657be42289e&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=1fbbfb15&#x26;sv=2" alt=""><figcaption></figcaption></figure>

After you enter the Cloudflare NS servers click the green checkmark to save the changes.

<figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FZ61D8UleYwBjm4yzsCre%252Fimage.png%3Falt%3Dmedia%26token%3D2e330bf2-840a-4468-bd6b-e23e52eb193a&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=a9f4bf5e&#x26;sv=2" alt=""><figcaption></figcaption></figure>

Then go back to Cloudflare and click the Continue button

<figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FwXC7omIbFQePpEFaguvH%252Fimage.png%3Falt%3Dmedia%26token%3Dd747a8eb-1b97-4942-a41c-8732a2237f23&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=827db0c2&#x26;sv=2" alt=""><figcaption></figcaption></figure>

Confirmation of changes can take from a few minutes to 24 - 48 hours while the new NS servers propagate across the Internet. After the domain status in Cloudflare changes to Active you can start the site deployment process. You can learn about domain activation:

* by the status at the top of the Cloudflare dashboard.

  <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FXX1klTU636M0p9qLPInn%252Fimage.png%3Falt%3Dmedia%26token%3D7d3a691a-8d43-433c-a5b2-9f9f8937b8e9&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=d526dbf6&#x26;sv=2" alt=""><figcaption></figcaption></figure>

  <figure><img src="https://lara-script.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F2391054755-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FKqXT4jWa7TDQpKKq2Yaf%252Fuploads%252FYMIiOx9bkF9iHZ56n3X4%252Fimage.png%3Falt%3Dmedia%26token%3D53e471f0-7421-4749-bf73-cab07fbc9db3&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=c4b99b6f&#x26;sv=2" alt=""><figcaption></figcaption></figure>

* or by an email from Cloudflare notifying you that the domain is already Active

<figure><img src="https://2918865942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fp0ow3kIXHQDcl9DBdYiM%2Fuploads%2FqZKO39fTgrhqyMZG4o9i%2Fimage.png?alt=media&#x26;token=d84cb416-d9ba-4e6b-87b1-7ea77c86804e" alt=""><figcaption></figcaption></figure>
