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

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

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

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

./dgraph zero ... some_configs

I realized this after reading the bash script that get.dgraph.io produces. :smiley:

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.)

1 Like

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.