# How create another subdirectory where ghost is already installed

**URL:** <https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354>\
**Category:** Developer help\
**Created:** [May 25, 2022, 3:03pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354 "2022-05-25T15:03:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![theomkarbirje](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@theomkarbirje](https://forum.ghost.org/u/theomkarbirje)\
**Post date:** [May 25, 2022, 3:03pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/1 "2022-05-25T15:03:13Z")

</div>

Hello,

I installed ghost with digital ocean one click ghost install and want to create a subdirectory to add another website within it.

So the structure look like.

[https://ghostblog.tld/website](https://ghostblog.tld/website)

I want to integrate a custom tool in sub directory .

What I do in this case?

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 25, 2022, 3:46pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/2 "2022-05-25T15:46:55Z")

</div>

Wouldn’t it be better to create a collection? Perhaps you can explain what you’re trying to achieve?

> **[Building content collections in Ghost](https://ghost.org/tutorials/content-collections/)**
>
> Ever wanted to create a curated group of posts on your Ghost site? With collections, you can! In this tutorial, we’ll show you what you need to know to create content collections.

---

<div class="post-metadata">

**Author:** ![theomkarbirje](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@theomkarbirje](https://forum.ghost.org/u/theomkarbirje)\
**Post date:** [May 25, 2022, 3:49pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/3 "2022-05-25T15:49:38Z")

</div>

I want to create a custom app on subdirectory

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 25, 2022, 4:33pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/4 "2022-05-25T16:33:09Z")

</div>

You’ll need to setup `nginx` to proxy the sub directory to the specific Ghost instance and port. Something like this…

```auto
location /folder(/.*)$ {
    rewrite ^ $1 break;
    proxy_pass https://ghostblog.tld:<port>/folder$1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

```

---

<div class="post-metadata">

**Author:** ![theomkarbirje](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@theomkarbirje](https://forum.ghost.org/u/theomkarbirje)\
**Post date:** [May 25, 2022, 5:49pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/5 "2022-05-25T17:49:55Z")

</div>

Hey,

Thanks for this but 2 questions 1). [https://ghostblog.tld](https://ghostblog.tld): I change this with the ip address or domain.

1. Where I add this in /etc/nginx/sites-enabled or somewhere else.

And I need to restart nginx or ghost after saving it.

Thanks

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 25, 2022, 6:26pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/6 "2022-05-25T18:26:13Z")

</div>

I suggest you read up on a few tutorials. Try this one for starters.

> **[Use NGINX as a Reverse Proxy](https://www.linode.com/docs/guides/use-nginx-reverse-proxy/)**
>
> Learn how to use NGINX as a reverse proxy. Understand how headers and buffers can help optimize your application’s performance.

Ghost is usually running on `http://localhost:<port>`. In contrast, `nginx` is proxying this to your chosen domain. You don’t edit anything in `sites-available` as this should only contain symbolic links to `sites-available`.

---

<div class="post-metadata">

**Author:** ![theomkarbirje](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@theomkarbirje](https://forum.ghost.org/u/theomkarbirje)\
**Post date:** [May 26, 2022, 4:05am UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/7 "2022-05-26T04:05:26Z")

</div>

Hello mjw,

I tried but I’m not expert in development field can you please help me to solve the exact problem.

See my current installation looks like  
Var/www/ghost for the main website

And for app I set

var/www/ghost/to

So what file I edit to serve ‘to’ folder.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 26, 2022, 8:52am UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/8 "2022-05-26T08:52:39Z")

</div>

> [@theomkarbirje](#):
>
> I tried but…

I don’t mind helping, but you need to be committed to read and learn too. You also need to be clear about what you’ve got working including the steps you’ve taken, and what remains to be done. It’s not clear if there is a problem or not as you’ve not shared sufficient information. Please format posts correctly too.

Is the ‘app’ another Ghost instance or something else? Each Ghost instance is installed at `/var/www`, so don’t nest them. Since you only have one _web server_, i.e., a single domain, all the changes are in the same `nginx`config files.

> [@theomkarbirje](#):
>
> …I’m not expert in development field…

You may fare better employing someone or using a Ghost hosting service.

---

<div class="post-metadata">

**Author:** ![theomkarbirje](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@theomkarbirje](https://forum.ghost.org/u/theomkarbirje)\
**Post date:** [May 26, 2022, 9:35am UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/9 "2022-05-26T09:35:49Z")

</div>

Sorry.

I love to learn. I learned about ghost by reading docs I started to build ghost theme by reading docs and watching YT videos.

But sometimes you need to take help of someone to solve some critical problem.

I also tried to do work with some freelancers on fiverr but not anyone able to do the work and tell me to use wordpress instead.

But I love ghost. So instead of wasting time. I decided to do it myself.

So here is full story.

I have a ghost installed on Digital ocean.  
at [https://tools.omkarbirje.com](https://tools.omkarbirje.com)

And I want to add my created web app which is not a ghost to subfolder.

That I need to install on this url

[https://tools.omkarbirje.com/app](https://tools.omkarbirje.com/app)

But after entering the url I get 404 on ghost.

I added the app in

Var/www/ghost/app

I also created conf.d in nginx to add code restart nginx but not working.

So I don’t know I did something wrong or right.

But I still lack some technical skills I’m unable to point the app on domain.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 26, 2022, 9:48am UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/10 "2022-05-26T09:48:55Z")

</div>

> [@theomkarbirje](#):
>
> But after entering the url I get 404 on ghost.

That’s because there’s no Ghost page, and your web server is only configured for Ghost.

You need to share more about the web app. What port does it run on, e.g., [http://localhost:1234](http://localhost:1234)? What is it written in, and is it setup with `systemd` etc.?

You shouldn’t need to edit `conf.d` since you already have the Ghost config for the domain. Likewise, install the app in `/var/www/app` not the Ghost folder.

---

<div class="post-metadata">

**Author:** ![vouchey](https://avatars.discourse-cdn.com/v4/letter/v/76d3ee/32.png) [@vouchey](https://forum.ghost.org/u/vouchey)\
**Post date:** [March 1, 2024, 2:51pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/11 "2024-03-01T14:51:15Z")

</div>

I gotta say, this one is mystifying me too. I’d like to create a subdirectory to run wordpress (it has handy plugins ghost does not) thus: [https://ghostblog.tld/wordpress](https://ghostblog.tld/wordpress)

The Nginx tutorial you referenced above is not clear, nor can I find any ghost documentation on how to create a subdirectory that can operate independent of ghost.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [March 1, 2024, 3:24pm UTC](https://forum.ghost.org/t/how-create-another-subdirectory-where-ghost-is-already-installed/30354/12 "2024-03-01T15:24:49Z")

</div>

> [@vouchey](#):
>
> nor can I find any ghost documentation on how to create a subdirectory that can operate independent of ghost.

This isn’t a Ghost question. It’s an Nginx question. :)

See if this helps?

> <https://gist.github.com/soheilhy/8b94347ff8336d971ad0>

or this?

> **[Wordpress CMS in a sub folder on Nginx and Ubuntu](https://medium.com/@franckmercado/wordpress-cms-in-a-sub-folder-on-nginx-and-ubuntu-b0a1cd91a008)**
>
> Given that for this example, the server’s setup is for multiple domain names under a single nginx configuration, what we can do to host a…
