# Websites on Dfinity

**URL:** <https://forum.dfinity.org/t/websites-on-dfinity/1952>\
**Category:** Developers\
**Created:** [February 6, 2021, 4:14pm UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952 "2021-02-06T16:14:49Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![CryptoKnight](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoknight/32/864_2.png) [@CryptoKnight](https://forum.dfinity.org/u/CryptoKnight)\
**Post date:** [February 6, 2021, 4:14pm UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/1 "2021-02-06T16:14:49Z")

</div>

How can we create and host websites on Dfinity?

---

<div class="post-metadata">

**Author:** ![enzo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/enzo/32/268_2.png) [@enzo](https://forum.dfinity.org/u/enzo)\
**Post date:** [February 6, 2021, 4:26pm UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/2 "2021-02-06T16:26:10Z")

</div>

Right now this is most easily accomplished using webpack. Check out the [phone book](https://github.com/dfinity/examples/tree/master/motoko/phone-book#phone-book) or [superheroes](https://github.com/dfinity/examples/tree/master/motoko/superheroes#superheroes) example.

---

<div class="post-metadata">

**Author:** ![CryptoKnight](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoknight/32/864_2.png) [@CryptoKnight](https://forum.dfinity.org/u/CryptoKnight)\
**Post date:** [February 6, 2021, 4:36pm UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/3 "2021-02-06T16:36:23Z")

</div>

Sorry I’m not a technical person  
I think i posted here by mistake  
Is there someone could help me build websites on Dfinity?

---

<div class="post-metadata">

**Author:** ![enzo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/enzo/32/268_2.png) [@enzo](https://forum.dfinity.org/u/enzo)\
**Post date:** [February 6, 2021, 4:50pm UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/4 "2021-02-06T16:50:12Z")

</div>

Are you familiar with HTML/CSS/JavaScript? What exactly do you want to build?

---

<div class="post-metadata">

**Author:** ![CryptoKnight](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoknight/32/864_2.png) [@CryptoKnight](https://forum.dfinity.org/u/CryptoKnight)\
**Post date:** [February 7, 2021, 10:52am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/5 "2021-02-07T10:52:58Z")

</div>

I’m familiar with HTML

---

<div class="post-metadata">

**Author:** ![ICPBoy](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpboy/32/1329_2.png) [@ICPBoy](https://forum.dfinity.org/u/ICPBoy)\
**Post date:** [May 10, 2021, 7:50pm UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/6 "2021-05-10T19:50:06Z")

</div>

Any guide how to host already built react website on dfinity?

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [May 10, 2021, 7:52pm UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/7 "2021-05-10T19:52:31Z")

</div>

This should get you going!

---

<div class="post-metadata">

**Author:** ![corest](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/corest/32/1308_2.png) [@corest](https://forum.dfinity.org/u/corest)\
**Post date:** [May 10, 2021, 11:15pm UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/8 "2021-05-10T23:15:16Z")

</div>

I’m sorry if asking the same questions someone asked before already.  
So, I have this folder structure:

> ```
> dfx.json
> public/
> index.html
> style.css
> 
> ```

Here is the content of dfx.json

> {  
> “canisters”: {  
> "www: {  
> “type”: “assets”,  
> “source”: [“public”]  
> }  
> }  
> }

When I try to deploy this project on local network (started with “dfx start”), I don’t get any errors on “dfx deploy”

But if I try to access then my HTML page, I get this error from accessing [HTTP://127.0.0.1:8000/?canisterId=r7inp-6aaaa-aaaaa-aaabq-cai](HTTP://127.0.0.1:8000/?canisterId=r7inp-6aaaa-aaaaa-aaabq-cai)

> An error happened:

> \_/\<@[http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:47697](http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:47697)  
> async\*\_loadJs@[http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:524975](http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:524975)  
> \_main@[http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:525933](http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:525933)  
> async\*@[http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:526235](http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:526235)  
> r@[http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:110](http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:110)  
> @[http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:902](http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:902)  
> @[http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:913](http://127.0.0.1:8000/bootstrap-70b8f66975aa20b1974d.js:2:913)

How can I debug what is wrong here? My HTML page loads without js console errors in the browser.

upd: found this comment is it still valid?

---

<div class="post-metadata">

**Author:** ![corest](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/corest/32/1308_2.png) [@corest](https://forum.dfinity.org/u/corest)\
**Post date:** [May 13, 2021, 8:17am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/9 "2021-05-13T08:17:20Z")

</div>

Replying to my own message, I was using old stable version 0.6.26 of dfx. But with latest 0.7.0-beta.8 everything works as expected

---

<div class="post-metadata">

**Author:** ![northman](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/northman/32/3980_2.png) [@northman](https://forum.dfinity.org/u/northman)\
**Post date:** [May 14, 2021, 3:11am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/10 "2021-05-14T03:11:17Z")

</div>

I wish I had read your note earlier. Thank you. My deployment now works as well.

---

<div class="post-metadata">

**Author:** ![rbole](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/rbole/32/1334_2.png) [@rbole](https://forum.dfinity.org/u/rbole)\
**Post date:** [May 22, 2021, 8:05am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/11 "2021-05-22T08:05:33Z")

</div>

Hi I try the same with

dfx --version  
dfx 0.7.0-beta.8

If I try to deploy a simple html page with  
`dfx deploy --network=ic`

I receive the following error??

```
dfx deploy --network=ic
Creating a wallet canister on the ic network.
The replica returned an HTTP Error: Http Error: status 404 Not Found, content type "text/html", content: <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.19.10</center>
</body>
</html>

```

What I have missing ?

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [May 22, 2021, 8:11am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/12 "2021-05-22T08:11:09Z")

</div>

you can’t deploy to mainnet just yet. try [fleek.co](http://fleek.co) if you want to bypass that restriction.

---

<div class="post-metadata">

**Author:** ![rbole](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/rbole/32/1334_2.png) [@rbole](https://forum.dfinity.org/u/rbole)\
**Post date:** [May 22, 2021, 8:13am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/13 "2021-05-22T08:13:35Z")

</div>

ok I see, I have tried [fleek.co](http://fleek.co) and that is working for me. I want try it by myself.

What is the reason why this is not working?

---

<div class="post-metadata">

**Author:** ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)\
**Post date:** [May 22, 2021, 8:33am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/14 "2021-05-22T08:33:07Z")

</div>

The various subnets are being rolled out in stages, public subnets are next on the list and then deployment will be open to all—it shouldn’t be long now.

---

<div class="post-metadata">

**Author:** ![treb0r](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/treb0r/32/8300_2.png) [@treb0r](https://forum.dfinity.org/u/treb0r)\
**Post date:** [June 17, 2021, 8:47am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/15 "2021-06-17T08:47:10Z")

</div>

Is it possible to directly deploy a website to the IC without using Fleek now?

---

<div class="post-metadata">

**Author:** ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)\
**Post date:** [June 17, 2021, 10:12am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/16 "2021-06-17T10:12:22Z")

</div>

Application subnets have been added now, you can deploy directly.

For static websites, Kyle has written a great article on this here.

---

<div class="post-metadata">

**Author:** ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)\
**Post date:** [June 17, 2021, 10:13am UTC](https://forum.dfinity.org/t/websites-on-dfinity/1952/17 "2021-06-17T10:13:40Z")

</div>

More details on the application subnets: [General Availability of Application Subnets](https://forum.dfinity.org/t/general-availability-of-application-subnets/5171)
