Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
No campo
Nomeie seu bucket insira um nome exclusivo para ele.
Clique em Continuar.
Na seção
Escolha onde armazenar seus dados, faça o seguinte:
Em Tipo de local, selecione Região e
selecione us-east1 (South Carolina) na lista.
Clique em Continuar.
Na seção
Escolher uma classe de armazenamento para os dados, faça o
seguinte:
Escolha Definir uma classe padrão e selecione Padrão.
Clique em Continuar.
Na seção
Escolha como controlar o acesso a objetos, faça o
seguinte:
Desmarque a caixa de seleção Aplicar a prevenção do acesso público neste bucket.
Em Controle de acesso, selecione Uniforme.
Clique em Continuar.
Na seção
Escolha como proteger os dados do objeto, mantenha os padrões
selecionados e clique em
Criar.
Faça upload de um objeto no bucket
Salve a seguinte imagem no seu dispositivo:
Na página Detalhes do bucket, na guia
Objetos, clique em
Fazer upload de arquivos
.
Na caixa de diálogo do arquivo, selecione o arquivo que você salvou.
Após a conclusão do upload, são exibidos o nome do arquivo e as informações sobre ele, como
tamanho e tipo.
Torne seu bucket público
Na página Detalhes do bucket, clique na guia
Permissões.
Verifique se a visualização está definida para
Ver pelos principais e clique em
Conceder acesso.
O painel Adicionar principais é exibido.
No campo
Novos principais, insiraallUsers.
Na caixa
Selecionar um papelselecioneCloud Storage
> Leitor de objetos do Storage.
Clique em Salvar.
Na página Você quer mesmo tornar esse recurso público?,
clique em Permitir acesso público.
Para verificar se o objeto foi compartilhado publicamente, clique na guia
Objetos e retorne para a lista de objetos.
A
coluna
Acesso públicodo objeto precisa serPúblico para a Internet. O botão Copiar URL fornece um URL compartilhável semelhante a este:
Na página Nova origem, na seção
Nome da origem, insira um nome para sua origem.
Em
Tipo de origem, selecione bucket de back-end.
Em
Definir seu bucket de back-end, selecione Novo bucket de back-end.
No campo Bucket do Cloud Storage, clique em Procurar.
Selecione o bucket do Cloud Storage criado anteriormente, clique em Selecionar e em Próxima.
Na seção
Anexar um balanceador de carga, selecione Criar novo balanceador de carga para mim, insira um nome para o balanceador de carga e clique em Avançar.
Em Desempenho do cache, mantenha os padrões selecionados e clique em
Concluído.
A nova origem aparece na lista de origens. Pode levar alguns minutos
para a origem ser totalmente criada. Só siga para a próxima etapa depois de receber
uma notificação indicando que a origem foi criada.
Testar o Cloud CDN
No console do Google Cloud , acesse a página Balanceamento de carga.
Clique no nome
do balanceador de carga que você criou anteriormente.
A página Detalhes do balanceador de carga é exibida.
Anote os endereços IPv4 exibidos em IP:Porta.
Teste o Cloud CDN inserindo o seguinte URL com o endereço IP do balanceador de carga em uma nova guia do navegador:
http://IP_ADDRESS/kitten.png
Seu navegador deve renderizar uma página com a imagem enviada.
Atualize a página várias vezes.
Volte para a página Detalhes do balanceador de carga e clique em Monitoramento.
Após alguns minutos, observe o tráfego exibido.
O tráfego veiculado diretamente do seu bucket de back-end é rotulado como
SERVED_FROM_BACKEND_BUCKET. O tráfego disponibilizado pelo
Cloud CDN é rotulado como SERVED_FROM_CACHE. Para mais informações, consulte Como monitorar métricas.
Limpar
Para evitar cobranças na conta do Google Cloud pelos
recursos usados nesta página, siga as etapas abaixo.
Exclua o balanceador de carga e o bucket de back-end:
No console do Google Cloud , acesse a página Balanceamento de carga.
Marque a caixa de seleção ao lado do balanceador de carga que você criou e
clique em Excluir.
Na página exibida, marque a caixa de seleção ao lado do bucket de back-end
que você criou e confirme se quer excluir o
balanceador de carga e os recursos selecionados.
Exclua o bucket do Cloud Storage:
No console Google Cloud , acesse a página Buckets do Cloud Storage.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-05 UTC."],[[["\u003cp\u003eThis guide demonstrates setting up a backend bucket as an origin for Cloud CDN using the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eYou'll create a Cloud Storage bucket, upload an object, and make it publicly accessible to use it as an origin.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves creating a backend bucket, setting up an external Application Load Balancer, and linking them.\u003c/p\u003e\n"],["\u003cp\u003eYou can test the Cloud CDN setup by accessing the uploaded image via the load balancer's IP address, observing traffic served from either the backend or the cache.\u003c/p\u003e\n"],["\u003cp\u003eThe guide details the steps required to clean up and delete the created resources.\u003c/p\u003e\n"]]],[],null,["Set up a backend bucket as an origin for Cloud CDN This quickstart shows you how to set up a backend bucket as an origin for\nCloud CDN by using the Google Cloud console.\n\n*** ** * ** ***\n\nTo follow step-by-step guidance for this task directly in the\nGoogle Cloud console, click **Guide me**:\n\n[Guide me](https://console.cloud.google.com/freetrial?redirectPath=/?walkthrough_id=cdn--console_quickstart)\n\n*** ** * ** ***\n\n\nBefore you begin Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n\nIn the Google Cloud console, on the project selector page,\nselect or create a Google Cloud project.\n| **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n[Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n\n\n[Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project). \nIn the Google Cloud console, on the project selector page,\nselect or create a Google Cloud project.\n| **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n[Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n\n\n[Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\nCreate a Cloud Storage bucket\n\n\n*Buckets* are the basic containers that hold your data in\nCloud Storage.\n\n\nTo create a bucket, follow these steps:\n\n1. In the Google Cloud console, go to the Cloud Storage **Buckets** page. \n\n [Go to Buckets](https://console.cloud.google.com/storage/browser)\n2. Click add_box **Create** . Show me.\n3.\n In the\n **Name your bucket** section, enter a unique name for your\n bucket.\n\n\n | **Warning:** Do not include sensitive information in the bucket name. The bucket namespace is global and publicly visible.\n\n \u003cbr /\u003e\n\n\n Click **Continue**.\n4. In the **Choose where to store your data** section, do the following:\n 1. For **Location type** , select **Region** , and then select `us-east1 (South Carolina)` from the list.\n 2. Click **Continue**.\n5. In the **Choose a storage class for your data** section, do the following:\n 1. Select **Set a default class** , and then select **Standard**.\n 2. Click **Continue**.\n6. In the **Choose how to control access to objects** section, do the following:\n - Clear the **Enforce public access prevention on this bucket** checkbox.\n - For **Access control** , select **Uniform**.\n - Click **Continue**.\n7. In the **Choose how to protect object data** section, keep the selected defaults, and then click **Create** .\n\nUpload an object into the bucket\n\n1. Save the following image on your device:\n\n2. On the **Bucket details** page, on the **Objects** tab, click **Upload files** .\n3. In the file dialog, select the file that you downloaded.\n\nAfter the upload completes, the filename and information about the file, such as its size and file type, are displayed.\n\nMake your bucket public\n\n1. On the **Bucket details** page, click the **Permissions** tab.\n2. Ensure that the view is set to\n **View by principals** , and then click\n **Grant access** .\n\n The **Add principals** pane is displayed.\n3. In the **New principals** field, enter `allUsers`.\n4. In the **Select a role** list, select **Cloud Storage\n \\\u003e Storage Object Viewer**.\n5. Click **Save**.\n6. On the **Are you sure you want to make this resource public?** page, click **Allow public access**.\n7. To verify that the object has been shared publicly, click the **Objects** tab to return to the list of objects. Your object's **Public access** column should read **Public to\n internet** . The **Copy URL** button provides a shareable URL similar to the following:\n\n\n `https://storage.googleapis.com/`\u003cvar translate=\"no\"\u003eYOUR_BUCKET_NAME\u003c/var\u003e`/kitten.png`\n\nCreate a backend bucket\n\nTo create a backend bucket and an external Application Load Balancer, do the following:\n\n1.\n In the Google Cloud console, go to the **Cloud CDN** page.\n\n [Go to Cloud CDN](https://console.cloud.google.com/net-services/cdn)\n\n \u003cbr /\u003e\n\n2. Click\n **Add origin** .\n\n3. On the **New origin** page, in the\n **Origin name**\n section, enter a name for your origin.\n\n4. For\n **Origin type** , select **Backend bucket**.\n\n5. For\n **Define your backend bucket** , select **New backend bucket**.\n\n6. In the **Cloud Storage bucket** field, click **Browse**.\n\n7. Select the Cloud Storage bucket that you created earlier, click\n **Select** , and then click **Next**.\n\n8. In the\n **Attach a load balancer** section, select **Create new load balancer\n for me** , enter a name for the load balancer, and then click **Next**.\n\n9. For **Cache performance** , keep the selected defaults, and then click\n **Done** .\n\n The new origin appears in the list of origins. It might take a few minutes\n for the origin to be fully created. Proceed to the next step only after you\n see a notification indicating that the origin has been created.\n\nTest Cloud CDN\n\n1. In the Google Cloud console, go to the **Load balancing** page.\n\n [Go to Load balancing](https://console.cloud.google.com/net-services/loadbalancing/list/loadBalancers)\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n2. Click the\n name of the load balancer that you created\n earlier.\n\n The **Load balancer details** page is displayed.\n3. Note the IPv4 addresses displayed under\n **IP:Port** .\n\n4. Test Cloud CDN by entering the following URL with the load\n balancer's IP address in a new browser tab:\n\n http://\u003cvar translate=\"no\"\u003eIP_ADDRESS\u003c/var\u003e/kitten.png\n\n Your browser should render a page with the uploaded image.\n5. Refresh the page multiple times.\n\n6. Return to the **Load balancer details** page, and then click **Monitoring**.\n\n7. After a few minutes, observe the served traffic.\n\n Traffic that is served directly from your backend bucket is labeled\n **SERVED_FROM_BACKEND_BUCKET** . Traffic that is served from\n Cloud CDN is labeled **SERVED_FROM_CACHE** . For more information,\n see [Monitoring metrics](/load-balancing/docs/https/https-logging-monitoring#monitoring_metrics).\n\n\nClean up\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\n1. Delete the load balancer and the backend bucket:\n\n 1. In the Google Cloud console, go to the **Load balancing** page.\n\n [Go to Load balancing](https://console.cloud.google.com/net-services/loadbalancing/list/loadBalancers)\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n 2. Select the check box next to the load balancer that you created, and\n then click **Delete**.\n\n 3. On the page that opens, select the check box next to the backend\n bucket that you created, and then confirm that you want to delete the\n load balancer and the selected resources.\n\n2. Delete the Cloud Storage bucket:\n\n 1. In the Google Cloud console, go to the Cloud Storage **Buckets** page. \n\n [Go to Buckets](https://console.cloud.google.com/storage/browser)\n 2. Select the checkbox next to the bucket that you created, and then click **Delete**.\n 3. In the **Delete bucket** dialog, confirm that you want to delete the bucket, and then click **Delete**.\n\n\nWhat's next\n\nHere's what you can do next:\n\n- [Set up Cloud CDN](/cdn/docs/using-cdn)\n- [Automate Cloud CDN setup with Terraform](/cdn/docs/cdn-terraform-examples)\n- [Authenticate content](/cdn/docs/private-content)"]]