Skip to main content

Sharing links to dapps

Beginner
Tutorial

Overview

Once a dapp has been deployed to the mainnet, the canister serves the dapp's frontend via a URL. This URL can be shared with anyone, allowing them to view and interact with your dapp without you needing to configure domain names, DNS records, or other networking configurations.

When a canister is deployed to the mainnet (with a command such as dfx deploy --network ic), the canister's ID will be returned in the output. For example, when deploying a project with two canisters, the output will resemble:

Deploying all canisters.
Creating canisters...
Creating canister "poll_backend"...
"poll_backend" canister created on network "ic" with canister id: "5o6tz-saaaa-aaaaa-qaacq-cai"
Creating canister "poll_frontend"...
"poll_frontend" canister created on network "ic" with canister id: "5h5yf-eiaaa-aaaaa-qaada-cai"
Building canisters...
Building frontend...
Installing canisters...
Installing code for canister poll_backend, with canister_id 5o6tz-saaaa-aaaaa-qaacq-cai
Installing code for canister poll_frontend, with canister_id 5h5yf-eiaaa-aaaaa-qaada-cai
Authorizing our identity (default) to the asset canister...
Uploading assets to asset canister...
/index.html 1/1 (472 bytes)
/index.html (gzip) 1/1 (314 bytes)
/index.js 1/1 (260215 bytes)
/index.js (gzip) 1/1 (87776 bytes)
/main.css 1/1 (484 bytes)
/main.css (gzip) 1/1 (263 bytes)
/sample-asset.txt 1/1 (24 bytes)
/logo.png 1/1 (25397 bytes)
/index.js.map 1/1 (842511 bytes)
/index.js.map (gzip) 1/1 (228404 bytes)
/index.js.LICENSE.txt 1/1 (499 bytes)
/index.js.LICENSE.txt (gzip) 1/1 (285 bytes)
Deployed canisters.

There are two canisters deployed, identified by their ids:

"poll_backend" canister created on network "ic" with canister id: "5o6tz-saaaa-aaaaa-qaacq-cai"
...
"poll_frontend" canister created on network "ic" with canister id: "5h5yf-eiaaa-aaaaa-qaada-cai"

You can use the following URL format to access your canister in the web browser:

https://<canister_id>.icp0.io

For example, to access a canister with a canister id of 5h5yf-eiaaa-aaaaa-qaada-cai:

https://5h5yf-eiaaa-aaaaa-qaada-cai.icp0.io

If you are sharing a link to a frontend (asset) canister, the frontend of the dapp will be displayed.

If you are sharing a link to a backend canisters, the CandidUI will be displayed.