# Installing (or building) dgraph on Linux without root/sudo access?

**URL:** <https://discuss.dgraph.io/t/installing-or-building-dgraph-on-linux-without-root-sudo-access/13567>\
**Category:** Dgraph\
**Created:** [April 6, 2021, 9:52pm UTC](https://discuss.dgraph.io/t/installing-or-building-dgraph-on-linux-without-root-sudo-access/13567 "2021-04-06T21:52:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CDKnightNASA](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/cdknightnasa/32/7529_2.png) [@CDKnightNASA](https://discuss.dgraph.io/u/CDKnightNASA)\
**Post date:** [April 6, 2021, 9:52pm UTC](https://discuss.dgraph.io/t/installing-or-building-dgraph-on-linux-without-root-sudo-access/13567/1 "2021-04-06T21:52:04Z")

</div>

To facilitate better answering of questions, if you have a question, please fill in the following info. Otherwise, please delete the template.

## What I want to do

I can run dgraph from a non-root user (with the --cwd and --log\_dir parameters) no problem, but I can’t either use the curl | bash installation method (which requires sudo) nor can I install from source (for that matter, even doing just a “make” to build also calls sudo.)

What I’d really like to see, at least with the github repo, is an autoconf or CMake build system that takes a --prefix or equivalent parameter/envvar so the defaults for DGraph point somewhere other than /usr/local and negates the need for sudo.

## What I did

Tried reading the Makefiles and the web.

## Dgraph metadata

[Decoder]: Using assembly version of decoder  
Page Size: 4096

Dgraph version : v20.11.3  
Dgraph codename : tchalla-3  
Dgraph SHA-256 : c3c1474369415e74b1a59ec7053cd1e585c9d55fe71243c72c48e313728d995a  
Commit SHA-1 : 8d3eb766c  
Commit timestamp : 2021-03-31 17:28:12 +0530  
Branch : HEAD  
Go version : go1.15.5  
jemalloc enabled : true

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [April 6, 2021, 9:57pm UTC](https://discuss.dgraph.io/t/installing-or-building-dgraph-on-linux-without-root-sudo-access/13567/2 "2021-04-06T21:57:55Z")

</div>

Some steps on the scripts needs sudo. There’s no other way.

One way for you is just downloading the binary and running it locally [dgraph-linux-amd64.tar.gz](https://github.com/dgraph-io/dgraph/releases/download/v20.11.3/dgraph-linux-amd64.tar.gz)

To run locally you have to be at the same path as the binary and run:

```auto
./dgraph zero ... some_configs

```

---

<div class="post-metadata">

**Author:** ![CDKnightNASA](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/cdknightnasa/32/7529_2.png) [@CDKnightNASA](https://discuss.dgraph.io/u/CDKnightNASA)\
**Post date:** [April 6, 2021, 10:16pm UTC](https://discuss.dgraph.io/t/installing-or-building-dgraph-on-linux-without-root-sudo-access/13567/3 "2021-04-06T22:16:03Z")

</div>

I realized this after reading the bash script that [get.dgraph.io](http://get.dgraph.io) produces. 😃

I suggest the DGraph download page and instructions add details to this effect and how DGraph can be started without requiring root. AFAICT the sudo is needed to add the dgraph user/group, install in /usr/local, create the empty folders, and install the systemctl configs (or equivalent.) When I want to run DGraph under a non-root user, all of this is unnecessary. (But, yes, I will need to figure a way to start/stop the processes.)

---

<div class="post-metadata">

**Author:** ![dmai](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/dmai/32/1254_2.png) [@dmai](https://discuss.dgraph.io/u/dmai)\
**Post date:** [April 6, 2021, 10:27pm UTC](https://discuss.dgraph.io/t/installing-or-building-dgraph-on-linux-without-root-sudo-access/13567/4 "2021-04-06T22:27:22Z")

</div>

In the GitHub repo the `make install` installation process doesn’t require sudo.It installs the binary to your GOBIN where you can then copy the `dgraph` binary wherever you wish.

---

<div class="post-metadata">

**Author:** ![MarkMankins](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/markmankins/32/11872_2.png) [@MarkMankins](https://discuss.dgraph.io/u/MarkMankins)\
**Post date:** [October 1, 2025, 12:03pm UTC](https://discuss.dgraph.io/t/installing-or-building-dgraph-on-linux-without-root-sudo-access/13567/5 "2025-10-01T12:03:04Z")

</div>

I know this is an old thread, but see [build: Build jemalloc without sudo by MarkMankins · Pull Request #9510 · hypermodeinc/dgraph · GitHub](https://github.com/hypermodeinc/dgraph/pull/9510) for a proposed fix.

---

<div class="post-metadata">

**Author:** ![rahst12](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/rahst12/32/2416_2.png) [@rahst12](https://discuss.dgraph.io/u/rahst12)\
**Post date:** [October 3, 2025, 3:29am UTC](https://discuss.dgraph.io/t/installing-or-building-dgraph-on-linux-without-root-sudo-access/13567/6 "2025-10-03T03:29:36Z")

</div>

I’m flagging this as related: [Jemalloc missing from docker container?](https://discuss.hypermode.com/t/jemalloc-missing-from-docker-container/19532) We also had jemalloc build issues.
