The Zulip developer environment works well on remote virtual machines. This can
be a good alternative for those with poor network connectivity or who have
limited storage/memory on their local machines.

We recommend giving the Zulip development environment its own virtual
machine, running Ubuntu 14.04 or
16.04, with at least 2GB of memory. If the Zulip development
environment will be the only thing running on the remote virtual
machine, we recommend installing
directly. Otherwise, we recommend the
Vagrant method so you can easily uninstall if you
need to.

After you have connected to your remote server, you need to install the
development environment.

If the Zulip development environment will be the only thing running on
the remote virtual machine, we recommend installing
directly. Otherwise, we recommend the
Vagrant method so you can easily uninstall if you
need to.

The main difference from the standard instructions is that for a
remote development environment, you’ll need to run exportEXTERNAL_HOST=<REMOTE_IP>:9991 in a shell before running run-dev.py
(and see also the --interface='' option documented below). If your
server has a static IP address, we recommend putting this command in
~/.bashrc, so you don’t need to remember to run it every time. This
allows you to access Zulip running in your development environment
using a browser on another host.

Once you have set up the development environment, you can start up the
development server with the following command in the directory where
you cloned Zulip:

./tools/run-dev.py--interface=''

This will start up the Zulip server on port 9991. You can then
navigate to http://<REMOTE_IP>:9991 and you should see something like
this screenshot of the Zulip development environment:

The --interface='' option makes the Zulip development environment
accessible from any IP address (in contrast with the much more secure
default of only being accessible from localhost, which is great for
developing on your laptop).

To properly secure your remote development environment, you can
port forward
using ssh instead of running the development environment on an exposed
interface. For example, if you’re running Zulip on a remote server
such as a DigitalOcean Droplet or an AWS EC2 instance, you can setup
port-forwarding to access Zulip by running the following command in
your terminal:

ssh-L3000:127.0.0.1:9991<username>@<remote_server_ip>-N

Now you can access Zulip by navigating to http://127.0.0.1:3000 in
your local computer’s browser.

Another way to edit directly on the remote development server is with
a command line text editor on the remote machine.

Two editors often available by default on Linux systems are:

Nano: A very simple, beginner-friendly editor. However, it lacks a lot of
features useful for programming, such as syntax highlighting, so we only
recommended it for quick edits to things like configuration files. Launch by
running command nano<filename>. Exit by pressing control-X.

Vim: A very powerful editor that can take a while
to learn. Launch by running vim<filename>. Quit Vim by pressing escape,
typing :q, and then pressing return. Vim comes with a program to learn it
called vimtutor (just run that command to start it).

For some applications (e.g. developing an OAuth2 integration for
Facebook), you may need your Zulip development to have a valid SSL
certificate. While run-dev.py doesn’t support that, you can do this
with an nginx reverse proxy sitting in front of run-dev.py..

The following instructions assume you have a Zulip Droplet working and
that the user is zulipdev; edit accordingly if the situation is
different.