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.
Di bagian
Beri nama bucket Anda, masukkan nama unik untuk bucket Anda.
Klik Lanjutkan.
Di bagian
Pilih tempat untuk menyimpan data, lakukan tindakan berikut:
Untuk Location type, pilih Region, lalu
pilih us-east1 (South Carolina) dari daftar.
Klik Lanjutkan.
Di bagian
Pilih kelas penyimpanan untuk data Anda, lakukan tindakan
berikut:
Pilih Tetapkan kelas default, lalu pilih Standard.
Klik Lanjutkan.
Di bagian
Choose how to control access to objects, lakukan hal berikut:
Hapus centang pada kotak Enforce public access prevention on this bucket.
Untuk Access control, pilih Uniform.
Klik Lanjutkan.
Di bagian
Pilih cara melindungi data objek, biarkan nilai default yang dipilih, lalu
klik
Buat.
Mengupload objek ke dalam bucket
Simpan gambar berikut di perangkat Anda:
Di halaman Bucket details, di tab
Objects, klik
Upload files
.
Di dialog file, pilih file yang Anda download.
Setelah upload selesai, nama file dan informasi tentang file tersebut, seperti
ukuran dan jenis file, akan ditampilkan.
Menjadikan bucket Anda bersifat publik
Di halaman Detail bucket, klik tab
Izin.
Pastikan tampilan disetel ke
Lihat menurut akun utama, lalu klik
Berikan akses.
Panel Add principals akan ditampilkan.
Di kolom
Akun utama baru, masukkan allUsers.
Dalam daftar
Select a role, pilih Cloud Storage
> Storage Object Viewer.
Klik
Simpan.
Di halaman Are you sure you want to make this resource public?,
klik Allow public access.
Untuk memverifikasi bahwa objek telah dibagikan secara publik, klik tab
Objek untuk kembali ke daftar objek.
Kolom
Public accessobjek Anda harus menampilkan Public to
internet. Tombol Copy URL menyediakan URL yang dapat dibagikan
yang serupa dengan URL berikut:
Di halaman New origin, di bagian
Origin name, masukkan nama untuk asal Anda.
Untuk
Origin type, pilih Backend bucket.
Untuk
Tentukan bucket backend Anda, pilih Bucket backend baru.
Di kolom Cloud Storage bucket, klik Browse.
Pilih bucket Cloud Storage yang Anda buat sebelumnya, klik Pilih, lalu klik Berikutnya.
Di bagian
Attach a load balancer, pilih Create new load balancer
for me, masukkan nama untuk load balancer, lalu klik Next.
Untuk Performa cache, tetap gunakan nilai default yang dipilih, lalu klik
Selesai.
Asal baru akan muncul dalam daftar asal. Mungkin diperlukan waktu beberapa menit
hingga origin dibuat sepenuhnya. Lanjutkan ke langkah berikutnya hanya setelah Anda
melihat notifikasi yang menunjukkan bahwa asal telah dibuat.
Menguji Cloud CDN
Di konsol Google Cloud , buka halaman Load balancing.
Klik
nama
load balancer yang Anda buat
sebelumnya.
Halaman Load balancer details akan ditampilkan.
Catat alamat IPv4 yang ditampilkan di bagian
IP:Port.
Uji Cloud CDN dengan memasukkan URL berikut dengan alamat IP load balancer di tab browser baru:
http://IP_ADDRESS/kitten.png
Browser Anda akan merender halaman dengan gambar yang diupload.
Muat ulang halaman beberapa kali.
Kembali ke halaman Load balancer details, lalu klik Monitoring.
Setelah beberapa menit, amati traffic yang ditayangkan.
Traffic yang disalurkan langsung dari bucket backend Anda diberi label
SERVED_FROM_BACKEND_BUCKET. Traffic yang disalurkan dari Cloud CDN diberi label SERVED_FROM_CACHE. Untuk mengetahui informasi selengkapnya, lihat Memantau metrik.
Pembersihan
Agar akun Google Cloud Anda tidak dikenai biaya untuk
resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut.
Hapus load balancer dan bucket backend:
Di konsol Google Cloud , buka halaman Load balancing.
Centang kotak di samping load balancer yang Anda buat, lalu klik Hapus.
Di halaman yang terbuka, centang kotak di samping bucket backend yang Anda buat, lalu konfirmasi bahwa Anda ingin menghapus load balancer dan resource yang dipilih.
Hapus bucket Cloud Storage:
Di Google Cloud konsol, buka halaman Bucket Cloud Storage.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)"]]