# How to update website files for IPFS on Linux

**URL:** <https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226>\
**Category:** Help\
**Tags:** go-ipfs\
**Created:** [February 15, 2021, 5:10pm UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226 "2021-02-15T17:10:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/ian/32/4620_2.png) [@Ian](https://discuss.ipfs.tech/u/Ian)\
**Post date:** [February 15, 2021, 5:10pm UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/1 "2021-02-15T17:10:08Z")

</div>

Hi, this is a very simple question but I’ve struggled to find a simple answer so far.

I have IPFS running on Linux (command line only), I added my website file index.html and pinned it according to many tutorials.

How do I go about updating the content of the website? It seems like just editing the file doesn’t reflect on what’s live. Tried re-pinning as well with no luck.

Any help is appreciated.

Ian

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [February 15, 2021, 6:53pm UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/2 "2021-02-15T18:53:39Z")

</div>

1. Edit
2. Re-add it → you will get a new hash
3. Your new website can be accessed on the new hash.

If you need a reference that does not change see:

`ipfs name publish <your hash>` (IPNS)

Or use dnslink ([https://dnslink.io](https://dnslink.io)).

---

<div class="post-metadata">

**Author:** ![Ian](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/ian/32/4620_2.png) [@Ian](https://discuss.ipfs.tech/u/Ian)\
**Post date:** [February 15, 2021, 7:47pm UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/3 "2021-02-15T19:47:35Z")

</div>

Thanks.

I modified my test.html file \> ipfs add test.html \> ipfs pin add test.html

The website does not load under the new hash at [ipfs.io/ipfs/exampleHash](http://ipfs.io/ipfs/exampleHash)

Am I missing something?

---

<div class="post-metadata">

**Author:** ![zacharywhitley](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zacharywhitley/32/2670_2.png) [@zacharywhitley](https://discuss.ipfs.tech/u/zacharywhitley)\
**Post date:** [February 15, 2021, 11:30pm UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/4 "2021-02-15T23:30:43Z")

</div>

Did it work before and is only not working with the new hash or have you never been successful retrieving a file from the gateway?

---

<div class="post-metadata">

**Author:** ![Ian](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/ian/32/4620_2.png) [@Ian](https://discuss.ipfs.tech/u/Ian)\
**Post date:** [February 16, 2021, 5:10am UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/5 "2021-02-16T05:10:34Z")

</div>

Yes, the test website loaded perfectly before I re-add and re-pin

---

<div class="post-metadata">

**Author:** ![zacharywhitley](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zacharywhitley/32/2670_2.png) [@zacharywhitley](https://discuss.ipfs.tech/u/zacharywhitley)\
**Post date:** [February 16, 2021, 1:33pm UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/6 "2021-02-16T13:33:53Z")

</div>

I’d double check to make sure your daemon is running.

---

<div class="post-metadata">

**Author:** ![kapad](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/kapad/32/4778_2.png) [@kapad](https://discuss.ipfs.tech/u/kapad)\
**Post date:** [March 25, 2021, 12:17am UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/7 "2021-03-25T00:17:28Z")

</div>

hello.  
You missed complete the point of hector’s answer …

lets say your page is here: /home/myipfs/site1/test.html

you publish your site, and connected with your main peer\_hash\_id

1. hash your site  
`ipfs add -r /home/myipfs/site1/`  
now you have a hash\_id that points to /home/myipfs/site1/

2. connect your site to your peer\_hash\_id  
`ipfs name publish <hash_id>`

You got an answer like this:  
`> Published to <peer_hash_id>: /ipfs/<hash_id>`

From now on your site is publish, under  
/ipns/\<peer\_hash\_id\>

ie: ipfs cat /ipns/\<peer\_hash\_id\>/test.html  
or: curl [https://gateway.ipfs.io/ipns/](https://gateway.ipfs.io/ipns/)\<peer\_hash\_id\>/test.html

- every time you change something inside your site, follow again steps 2 and 3
- what you publish in step 3, is the hash of the root folder of your site, and not the hash of ‘test.html’, except if your site is just that page.

+++ in any case, [IPNS | IPFS Docs](https://docs.ipfs.io/concepts/ipns/) has the key …

---

<div class="post-metadata">

**Author:** ![zacharywhitley](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zacharywhitley/32/2670_2.png) [@zacharywhitley](https://discuss.ipfs.tech/u/zacharywhitley)\
**Post date:** [March 25, 2021, 1:47pm UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/8 "2021-03-25T13:47:59Z")

</div>

…and you seem to have completely missed the question. They said the re-added it and re-pinned it. The only confusion is if they tried using the old hash or the new hash. (I’m guessing theres’ a good chance they indeed tried the new hash) If they did try the old hash there could be some confusion about hashes in which case IPNS is what they’re looking for. If they did use the new hash then something else is going on.

Since you seem to enjoy critiquing other peoples responses let me offer that you should confine yourself to the quality of your own responses.

---

<div class="post-metadata">

**Author:** ![0xPrey](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/0xprey/32/4801_2.png) [@0xPrey](https://discuss.ipfs.tech/u/0xPrey)\
**Post date:** [March 29, 2021, 7:30pm UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/9 "2021-03-29T19:30:04Z")

</div>

I would maybe think about using a service like [Fleek](https://fleek.co) and looking at their [Space SDK](https://github.com/FleekHQ/space-sdk).

---

<div class="post-metadata">

**Author:** ![michelc](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/michelc/32/4937_2.png) [@michelc](https://discuss.ipfs.tech/u/michelc)\
**Post date:** [April 24, 2021, 8:03am UTC](https://discuss.ipfs.tech/t/how-to-update-website-files-for-ipfs-on-linux/10226/10 "2021-04-24T08:03:24Z")

</div>

Dear @Ian,

I encounter often similar problems due to network “isolation” … a public gateway might take some long time to discover your new files.  
Also I have noticed that /ipns/ urls take about 2 minutes to “propagates” (w/o pubsub) … any link with and ipns key might get resolved with an older version of the mutable.

I put together a little static site you can modify (editable) and publish and test the  
gateways : [https://gateway.ipfs.io/ipfs/QmZZ5PTYCjET19PZfUBA22psuoXwt4L2wQVD6KYZ1icsaN/](https://gateway.ipfs.io/ipfs/QmZZ5PTYCjET19PZfUBA22psuoXwt4L2wQVD6KYZ1icsaN/)

Here is what I usually do for publishing a static site:

- place a pin on the files,
- connect a public gateway via its PeerID
- send a HEAD request for the gateway to fetch the files

and I repeat the 3 steps every time I changed a file on the website.

This can be done with the following command lines:

```auto
hash=$(ipfs add -w index.html style.css --pin=true -Q)
ipfs swarm connect /ip4/147.75.109.213/udp/4001/quic/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN
curl -I https://gateway.ipfs.io/ipfs/$hash/ | grep -i ipfs
xdg-open https://gateway.ipfs.io/ipfs/$hash/

```

w/ care  
+Michelc (aka Dr IT)  
–&nbsp;  
[http://www.drit.ml](http://www.drit.ml)
