# Site is working in local server but not after build

**URL:** <https://discourse.gohugo.io/t/site-is-working-in-local-server-but-not-after-build/19135>\
**Category:** support\
**Created:** [June 11, 2019, 9:25am UTC](https://discourse.gohugo.io/t/site-is-working-in-local-server-but-not-after-build/19135 "2019-06-11T09:25:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xavierbriole](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/xavierbriole/32/8910_2.png) [@xavierbriole](https://discourse.gohugo.io/u/xavierbriole)\
**Post date:** [June 11, 2019, 9:25am UTC](https://discourse.gohugo.io/t/site-is-working-in-local-server-but-not-after-build/19135/1 "2019-06-11T09:25:15Z")

</div>

Hello,

I’ve read and followed [this tutorial](https://www.digitalocean.com/community/tutorials/how-to-deploy-a-hugo-site-to-production-with-git-hooks-on-ubuntu-14-04) to deploy automatically a Hugo site on a server after a git push.

When I run `hugo server` command in my local directory, the site render perfectly but when I check on the production server, there’s some files missing … the console output give this :

 ![52](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/e/e184eda8536c0f9f825840f4c2911f2a46dd9a68.png)

Why on the local server it’s working great ? The compilation is meant to work too if there’s no error when launching server 😕

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [June 11, 2019, 10:39am UTC](https://discourse.gohugo.io/t/site-is-working-in-local-server-but-not-after-build/19135/2 "2019-06-11T10:39:46Z")

</div>

Have you set the correct baseURL? That is a common mistake.

> **[Configure Hugo](https://gohugo.io/getting-started/configuration/#all-configuration-settings)**
>
> How to configure your Hugo site.

---

<div class="post-metadata">

**Author:** ![xavierbriole](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/xavierbriole/32/8910_2.png) [@xavierbriole](https://discourse.gohugo.io/u/xavierbriole)\
**Post date:** [June 11, 2019, 10:47am UTC](https://discourse.gohugo.io/t/site-is-working-in-local-server-but-not-after-build/19135/3 "2019-06-11T10:47:56Z")

</div>

Yes, the baseURL is set with the domain server address.

---

<div class="post-metadata">

**Author:** ![funkydan2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/funkydan2/32/5636_2.png) [@funkydan2](https://discourse.gohugo.io/u/funkydan2)\
**Post date:** [June 11, 2019, 11:13am UTC](https://discourse.gohugo.io/t/site-is-working-in-local-server-but-not-after-build/19135/4 "2019-06-11T11:13:41Z")

</div>

The terminal output says there are 5 English pages produced and 4 French. How many do you expect?

Are you running the same version of Hugo in development and production?

The _warnings_ are interesting? Do they show up in your development environment? Is your theme/layouts properly configured?

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [June 11, 2019, 1:24pm UTC](https://discourse.gohugo.io/t/site-is-working-in-local-server-but-not-after-build/19135/5 "2019-06-11T13:24:46Z")

</div>

Problem 1: I don’t see in your post-receive hook anything that implies that your theme is checked out. If you use your own theme inside of the layouts folder then read on, if you are using a theme in the themes folder that you use via submodule have a look at the checked out files and verify that you don’t have your theme there. If so, your receive hook probably needs another command that checks out submodules or loads the theme however it is put into your repo.

Problem 2: @bep somewhere wrote something about parallel creation of pages. What I see from your output warnings is that you have no standard templates for pages, home and taxonomyTerms. Because the production is running in parallel on your local station it probably thinks it’s a package page and creates the files anyway. On the live server you might not have the same amount of processing capabilities and that leads to those pages missing.

My guess is it’s door number 1.

---

<div class="post-metadata">

**Author:** ![xavierbriole](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/xavierbriole/32/8910_2.png) [@xavierbriole](https://discourse.gohugo.io/u/xavierbriole)\
**Post date:** [June 11, 2019, 4:56pm UTC](https://discourse.gohugo.io/t/site-is-working-in-local-server-but-not-after-build/19135/6 "2019-06-11T16:56:22Z")

</div>

Indeed, the checkout of `themes` folder was missing in the `post-receive` script.  
I added a line to clone the theme from GitHub after the clone of my blog repository and the build was successfully done.  
I don’t know if it’s the right way but this way can always get the last version of the theme so I think it’s cool.

Thanks! 🙂

_Edit: or simpler, add the `--recurse-submodules` param to the `git clone` command in the `post-receive` script if the theme is a submodule._
