--- title: "Get started with CDN" description: "Turn on E2E CDN for your account, serve a public Object Storage bucket through it, and check that a file loads from its Distribution URL." content_type: "get-started" product: "cdn" platform: "MyAccount" url: "/myaccount/cdn/get-started/" --- # Get started with CDN Serve a file from your E2E Object Storage bucket through the CDN, at the address of your first distribution. The CDN keeps copies of the file at edge locations around the world, so each visitor gets it from a location near them. A command at the end shows it working. A bucket is the quickest origin to start with, since **Add to CDN** fills in its details for you. To serve files from your own web server instead, see [Create a distribution](/myaccount/cdn/how-to/create-a-distribution/). You need: - A bucket in E2E Object Storage with at least one file in it, such as an image. See [Create a bucket](/myaccount/object-storage/how-to/create-a-bucket/) and [Upload and download objects](/myaccount/object-storage/how-to/upload-and-download-objects/). - A completed account setup. Otherwise **Request CDN** opens the profile setup first. CDN is a paid service, billed through a monthly CDN plan. See [How is CDN billed?](/myaccount/cdn/faq/#how-is-cdn-billed) and [E2E's pricing page](https://www.e2enetworks.com/pricing). ## Ask E2E to turn CDN on E2E turns CDN on for your account when you ask, before your first distribution. One request covers the whole account. 1. In MyAccount, under **Network**, click **CDN**. If you have no distribution yet, click **Get Started**. **Manage CDN Services** opens. 2. If **Create CDN** shows, CDN is already on for your account. Go to the next section. 3. Click **Request CDN**. 4. In **Reason**, tell E2E about your business and what you will serve through the CDN, such as "Images and videos for www.example.com". A reason is required, up to 500 characters. 5. Click **Request CDN** in the dialog. You see **Request for CDN service created successfully.**, and E2E reviews the request. While it waits, **Request CDN** opens a message that your request is under process. Once E2E approves it, **Create CDN** shows on **Manage CDN Services** in place of **Request CDN**. Open the page again to check. Meanwhile, you can carry on with the next section. For what to do if the approval is taking a while, see [Request CDN](/myaccount/cdn/how-to/request-cdn/#while-you-wait). ## Make the bucket public The CDN reads your files the way any visitor does, so the bucket must allow anyone to read them. Turn on public access with **Download** and **Listing** checked; **Add to CDN** needs both. This opens every file in the bucket to anyone who has its address, so keep only files you mean to publish in it. See [Make a bucket public](/myaccount/object-storage/how-to/make-a-bucket-public/). ## Add the bucket to the CDN Once your CDN request is approved: 1. In MyAccount, open Object Storage, and find your bucket in the list. 2. In the bucket's **Actions** menu, choose **Add to CDN**. **CDN Distribution with \ as origin** opens, with your bucket's name in place of ``. 3. Check the form: - **Origin Domain Name** is filled in with your bucket's address and cannot be changed. - Leave **Origin path** empty, to serve the whole bucket. - Keep **Origin ID** as it is filled in. - The certificate is **E2E SSL Certificate (\*.e2enetworks.net)**. 4. Click **Create CDN**. You land back in Object Storage with **Bucket CDN created successfully**. The bucket now has a **Bucket CDN** tab, and **Add to CDN** is no longer available for it. ## Close the bucket's file list Now that the bucket is added to the CDN, anyone can see the names of all the files in it at the distribution's root address, because **Add to CDN** needs **Listing**. To keep the names private, open the bucket's **Permissions** tab, click **Public Access Config**, clear **Listing**, keep **Download** checked, and click **Save Permission**. The root address then returns an HTTP 403 error, and your files keep loading through the CDN. If you later delete the distribution, check **Listing** again first, so that **Add to CDN** is available for the bucket again. For a website, also set **Default Root object** to your home page, such as index.html, so the root address returns that page in place of the 403 error; see [Change the basic settings](/myaccount/cdn/how-to/change-distribution-settings/#change-the-basic-settings). If the CDN served the list before you closed it, clear the cache for the path `/` with **Flush Cache** on the distribution's **Invalidations** tab; see [Clear the cache](/myaccount/cdn/how-to/clear-the-cache/). ## Wait for the distribution to deploy In MyAccount, under **Network**, click **CDN**. Your new distribution is on **Manage CDN Services**, with the bucket's address under **Domain Name**. It shows **InProgress** and **Disabled** while it deploys to the edge locations. This takes up to 30 minutes, and the page can show the change up to 15 minutes after that. When it shows **Deployed** and **Enabled**, the distribution is serving files. Copy the address under **Distribution URL**. You use it in the next step. ## Check that a file loads through the CDN Ask for one of your files at the Distribution URL, from any computer with `curl`: ```bash curl -I https:/// ``` Replace `` with the address you copied, and `` with the file's path in the bucket, such as `images/logo.png`. The first line of the output shows the status `200`, which means the CDN served the file. Open the same address in a browser to see the file itself. Use `https://`: every new distribution starts with **Viewer Protocol Policy** set to **HTTPS Only**. To let visitors use `http://` too, see [Change distribution settings](/myaccount/cdn/how-to/change-distribution-settings/#how-visitors-connect). Your bucket's files are now served through the CDN. Put the Distribution URL in your site's pages wherever they link to these files. ## What to do next - [Clear the cache](/myaccount/cdn/how-to/clear-the-cache/): make visitors get a file you changed in the bucket. - [Change distribution settings](/myaccount/cdn/how-to/change-distribution-settings/): how long files stay cached, and how visitors connect. - [Create a distribution](/myaccount/cdn/how-to/create-a-distribution/): serve files from your own web server. - [Troubleshooting CDN](/myaccount/cdn/troubleshooting/cdn/) and [CDN FAQ](/myaccount/cdn/faq/): fixes for common problems, and short answers.