# Using compas\_RPC on remote server

**URL:** https://forum.compas-framework.org/t/using-compas-rpc-on-remote-server/437
**Category:** compas
**Created:** [February 18, 2021, 7:56am UTC](https://forum.compas-framework.org/t/using-compas-rpc-on-remote-server/437 "2021-02-18T07:56:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ney-llo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/ney-llo/32/253_2.png) [@ney-llo](https://forum.compas-framework.org/u/ney-llo)
#### Post date: [February 18, 2021, 7:56am UTC](https://forum.compas-framework.org/t/using-compas-rpc-on-remote-server/437/1 "2021-02-18T07:56:48Z")

</div>

Hi there!

Thanks for the work on compas so far! Is there some experience at BRG to run the RPC remotely? Or to work in a remote anaconda environment. Such a solution would allow us to use compas/python in GH without the need to set up a local environment for every employer at the office wanting to just open/run a script or make minor adjustments.

I ask because of the note at [tutorial/rpc page](https://compas.dev/compas/latest/tutorial/rpc.html):

> Currently, the RPC server is launched on the `localhost` . However, it would also be possible to launch it on a remote computer on a network, or on a server reachable over the internet.

Have a nice day,  
Lennert

---

<div class="post-metadata">

### Author: ![gonzalocasas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/gonzalocasas/32/127_2.png) [@gonzalocasas](https://forum.compas-framework.org/u/gonzalocasas)
#### Post date: [February 20, 2021, 11:22am UTC](https://forum.compas-framework.org/t/using-compas-rpc-on-remote-server/437/2 "2021-02-20T11:22:40Z")

</div>

Hi @ney-llo

Yes, this should work. The RPC server already binds to `0.0.0.0` (which means it listens to all network interfaces), so, if the machine on which you set this up is reachable over the network, the service would be available. Then you’d need to start the proxy with the URL of your compas server, eg.:

```auto
from compas.rpc import Proxy

with Proxy('compas.numerical', url='http://compas.ney.partners') as numerical:
    # here do something with remote RPC

```

**IMPORTANT:** Please notice that this basically allows remote code execution on your server, so, you should secure it properly. This mean, do not put it open on the internet (either make it available only through your internal network and/or over your private vpn, or add an extra layer of authentication on top), ideally, sandbox the execution environment as well. As an (admittedly trivial) way to sandbox it, I would suggest to at least run the RPC server in Docker containers. I’ve put together a minimal example to build a docker container that starts an RPC server ready to serve external requests, [check it out here](https://gist.github.com/gonzalocasas/6202fb57ae39948744d4b36767d6908a), it should be as simple as “compose up” on this one and it should work.

Cheers

---

<div class="post-metadata">

### Author: ![ney-llo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/ney-llo/32/253_2.png) [@ney-llo](https://forum.compas-framework.org/u/ney-llo)
#### Post date: [February 20, 2021, 1:11pm UTC](https://forum.compas-framework.org/t/using-compas-rpc-on-remote-server/437/3 "2021-02-20T13:11:47Z")

</div>

Thanks Gonzalo. I will have a look at it.
