# Nextcloud Server Environment Setup

**URL:** <https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360>\
**Category:** 💻 Development\
**Created:** [September 28, 2022, 3:51am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360 "2022-09-28T03:51:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Entropy\_Time](https://help.nextcloud.com/user_avatar/help.nextcloud.com/entropy_time/32/46167_2.png) [@Entropy\_Time](https://help.nextcloud.com/u/Entropy_Time)\
**Post date:** [September 28, 2022, 3:51am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/1 "2022-09-28T03:51:32Z")

</div>

I am attempting an issue as a first-time contributor and am lost on how to properly set up the dev. environment. I use a VM for Ubuntu 20.04 and followed [Development environment — Nextcloud latest Developer Manual latest documentation](https://docs.nextcloud.com/server/latest/developer_manual/getting_started/devenv.html) but ran into errors with no idea on how to remedy them, so any advice would be helpful.

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [September 28, 2022, 5:02am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/2 "2022-09-28T05:02:25Z")

</div>

Honestly, I am using a [different dev environment](https://github.com/christianlupus/nextcloud-docker-debug). Thus, I do not know typical pitfalls of your dev environment setup.

Nevertheless, I am willing to help with the setup if I can. To help you, I however need more information on what you were doing and what the results are. What type of errors? Are there messages? Any clue what the problem is. What is working? What is not working?

---

<div class="post-metadata">

**Author:** ![Entropy\_Time](https://help.nextcloud.com/user_avatar/help.nextcloud.com/entropy_time/32/46167_2.png) [@Entropy\_Time](https://help.nextcloud.com/u/Entropy_Time)\
**Post date:** [September 28, 2022, 7:22am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/3 "2022-09-28T07:22:59Z")

</div>

On an M1 Macbook Air; used UTM to simulate a Ubuntu 20.04 OS; installed apache (apache2); chmod and cd into /var/www and cloned the repository. This is where the issues arise as I don’t have any experience with large open-source projects. Attempted “git submodule update --init” as it’s what the setup dictated but that failed due to there not being a repository. I believe I’m missing a key part as each issue arises from there not being that certain directory but I am not sure.

Thank you in advance for any help or resources.

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [September 28, 2022, 9:05am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/4 "2022-09-28T09:05:16Z")

</div>

So, your path that apache is publishing is `/var/www`?

What is located in `/var/www` after the `git clone ...` command? Have you successfully changed the folder to `/var/www` before trying to init the submodules?

BTW: You can add `--filter blob:none` to the `git clone` command to prevent too much data being downloaded.

---

<div class="post-metadata">

**Author:** ![Entropy\_Time](https://help.nextcloud.com/user_avatar/help.nextcloud.com/entropy_time/32/46167_2.png) [@Entropy\_Time](https://help.nextcloud.com/u/Entropy_Time)\
**Post date:** [September 28, 2022, 9:15am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/5 "2022-09-28T09:15:39Z")

</div>

So, within the /var/www directory, I cloned the rep; I think it’s easiest to just show an image so I attached a screenshot.

 ![Screen Shot 2022-09-28 at 5.12.59 AM](https://help.nextcloud.com/uploads/default/original/3X/b/d/bd384e691a8ea0d228c7de1db8f2f2c55708c597.jpeg)

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [September 28, 2022, 9:35am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/6 "2022-09-28T09:35:27Z")

</div>

OK, most probably, your Ubuntu installation is using `/var/www/html` as the document root of the apache server. This is the default (not `/var/www`).

Next, you need to clone the server directly into the document root folder, typically. Just to be sure: **There is no other page active on that machine, right?** If there is, be careful to not remove existing data.

In your case , you will have to do

```bash
sudo chown entropy: -R /var/www/html
git clone --filter blob:none https://github.com/nextcloud/server.git /var/www/html
cd /var/www/html
git submodule update --init
mkdir data
sudo chown -R www-data: config data apps

```

That should install the basic server as described in [the documentation](https://docs.nextcloud.com/server/latest/developer_manual/getting_started/devenv.html#check-out-the-code).

* * *

_You will have to clean up some other folders if this is working._

---

<div class="post-metadata">

**Author:** ![Entropy\_Time](https://help.nextcloud.com/user_avatar/help.nextcloud.com/entropy_time/32/46167_2.png) [@Entropy\_Time](https://help.nextcloud.com/u/Entropy_Time)\
**Post date:** [September 28, 2022, 10:04am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/7 "2022-09-28T10:04:49Z")

</div>

Okay, this has advanced my situation; thank you so much for the help. I may further reply to this post if I need further advisement if that’s fine.

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [September 28, 2022, 10:07am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/8 "2022-09-28T10:07:53Z")

</div>

Yes, you can write for sure.

It would be nice if you could mark the topic as solved once you are done with everything. (put a timed bookmark for yourself to remind yourself of it)

---

<div class="post-metadata">

**Author:** ![Entropy\_Time](https://help.nextcloud.com/user_avatar/help.nextcloud.com/entropy_time/32/46167_2.png) [@Entropy\_Time](https://help.nextcloud.com/u/Entropy_Time)\
**Post date:** [September 28, 2022, 10:16am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/9 "2022-09-28T10:16:02Z")

</div>

Okay, I will go ahead and mark it as solved. I did encounter another issue but I believe that’s covered in [No database drivers (sqlite, mysql, or postgresql) installed - #3 by osrehe](https://help.nextcloud.com/t/no-database-drivers-sqlite-mysql-or-postgresql-installed/34111/3)

 ![Screen Shot 2022-09-28 at 6.10.00 AM](https://help.nextcloud.com/uploads/default/original/3X/b/6/b6ea48e53c3c9680ff40f8c05ac994f5acccd0d0.png)

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [September 28, 2022, 11:39am UTC](https://help.nextcloud.com/t/nextcloud-server-environment-setup/146360/10 "2022-09-28T11:39:32Z")

</div>

@Entropy_Time you can remove the folders `/var/www/data` and `/var/www/server` by calling

```bash
rm -rf /var/www/data /var/www/server

```

Then, there should be nothing in `/var/www` except for a folder `html`.
