Problems Using sync-gateway - Initial setup

Moving from https://github.com/couchbase/sync_gateway/issues/1995

I finally got sync_gateway working. But not from the command line. I did not know how to edit the config for the daemon. I found a thread somewhere that showed how. In case others run into this, here’s what worked for me:

Run sudo su - sync_gateway to login as the sync_gateway user.
Run vi sync_gateway.json to edit the config. An example looks something like this:

 {
     "log": ["HTTP+"],
     "adminInterface": "127.0.0.1:4985",
     "interface": "0.0.0.0:4984",
     "databases": {
             "grocery-sync": {
                     "server": "http://localhost:8091",
                     "bucket": "grocery-sync",
                     "users": {
                             "GUEST": {"disabled": false, "admin_channels": ["*"] }
                     }
             }
     }
 }

Save the config.

Type exit then press Enter
Execute sudo service sync_gateway reload to re-initialize.
What would be the equivalent command line version to start sync_gateway with the above config?

The service script targets a specific file location - to have the service target a different location, you’d need to modify the service script.

To simply start Sync Gateway with a specific parameter, you just need to run
./sync_gateway /path/to/your/config.json