# How to run julia code remotely on another local machine?

**URL:** https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765
**Category:** General Usage
**Created:** [October 21, 2020, 6:32pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765 "2020-10-21T18:32:56Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)
#### Post date: [October 21, 2020, 6:32pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/1 "2020-10-21T18:32:56Z")

</div>

My main machine is a MacBook Pro, where I edit Julia.  
I also have a PC running Windows that has an 8-core CPU and a GTX-1070ti.  
I can connect them via local LAN.

Is there some good way that I could send Julia that I edit on a notebook on the mac to be executed on the PC? I’m thinking of some ML tasks that could use the GPU.

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [October 21, 2020, 6:45pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/2 "2020-10-21T18:45:23Z")

</div>

Configure [`SSH`](https://en.wikipedia.org/wiki/Ssh_(Secure_Shell)) and launch the notebook on your desktop machine. If you port-forward the notebook port correctly through the SSH tunnel you can open the notebook in a browser on your laptop. I have never tried this on Windows though, but I assume it should be doable.

---

<div class="post-metadata">

### Author: ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)
#### Post date: [October 21, 2020, 6:57pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/3 "2020-10-21T18:57:36Z")

</div>

Oh, I could have thought of that (but didn’t). I’ll just need to install an SSH server on the PC. I’m pretty sure the client version of Windows doesn’t have one.

---

<div class="post-metadata">

### Author: ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)
#### Post date: [October 21, 2020, 7:12pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/4 "2020-10-21T19:12:34Z")

</div>

After thinking some more, I probably should install some linux on the PC (dual boot). I’ve run open source software on windows some years ago, but it wasn’t a particularly nice experience. Basic tools run nicely, but then you want a compiler and specific libraries, etc. Cygwin is pretty ok, but still not that great. I see that CUDA is available for several distros, so that’s a good start.

---

<div class="post-metadata">

### Author: ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)
#### Post date: [October 21, 2020, 7:42pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/5 "2020-10-21T19:42:12Z")

</div>

If you use VSCode you can install the remote editting extension. This lets you use your IDE on your main computer but comfortably edit code with all the goodies of VSCode.

---

<div class="post-metadata">

### Author: ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)
#### Post date: [October 21, 2020, 8:00pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/6 "2020-10-21T20:00:52Z")

</div>

Cool! [Visual Studio Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview)

---

<div class="post-metadata">

### Author: ![LysandrosAn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lysandrosan/32/12528_2.png) [@LysandrosAn](https://discourse.julialang.org/u/LysandrosAn)
#### Post date: [October 21, 2020, 8:02pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/7 "2020-10-21T20:02:07Z")

</div>

Take a look at how the most high-performance computing facilites handle this. Usually, they run on a Linux environment and access to the machine is achieved by a SSH, as @fredrikekre already mentioned. There are numerous providers for windows, mac and linux that are building the bridge to the remote computer. Submission of jobs is done by batch scripts, for know simplified commands are available (e.g. with so called _slurm_ syntax).

---

<div class="post-metadata">

### Author: ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)
#### Post date: [October 21, 2020, 8:06pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/8 "2020-10-21T20:06:25Z")

</div>

Well, cloud storage would be an easy way to go. More old school would be an NFS shared directory.

---

<div class="post-metadata">

### Author: ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)
#### Post date: [October 21, 2020, 8:22pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/9 "2020-10-21T20:22:33Z")

</div>

Maybe I should use docker… I should be able to install docker desktop to the windows machine, and submit Julia+CUDA to it using the mac’s command line tools, and of course the mac would also have docker desktop for easy development. There’s already an Nvidia image for CUDA, just put Julia on top.  
[https://hub.docker.com/r/nvidia/cuda/](https://hub.docker.com/r/nvidia/cuda/)  
This way I wouldn’t need to install any linux on the PC, saving some work.

---

<div class="post-metadata">

### Author: ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)
#### Post date: [October 21, 2020, 8:29pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/10 "2020-10-21T20:29:41Z")

</div>

As a meta-thought, my original problem was that I mislabeled the problem, and now I’ve relabelled it a few times. (I just finished books by Daniel Kahneman and Chris Voss.)

---

<div class="post-metadata">

### Author: ![jebej](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jebej/32/1784_2.png) [@jebej](https://discourse.julialang.org/u/jebej)
#### Post date: [October 21, 2020, 11:39pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/11 "2020-10-21T23:39:23Z")

</div>

You don’t need SSH, just configure the notebook server on your Windows PC properly and open the right port in the Windows firewall. This should be very easy, you don’t need to mess with certificates and router port forwarding as long as you are inside the LAN.

I am assuming you mean Jupyter, but the same idea works with Pluto: [Running a notebook server — Jupyter Notebook 6.4.12 documentation](https://jupyter-notebook.readthedocs.io/en/stable/public_server.html)

---

<div class="post-metadata">

### Author: ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)
#### Post date: [October 22, 2020, 7:50am UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/12 "2020-10-22T07:50:02Z")

</div>

@jebej You’re right in a way, SSH is not needed for having access to the notebook. SSH is useful for remotely running things on the PC from the Mac.  
Using SSH does not need certificates, just the old-fashioned public key based auth is enough. You can use certificates, apparently, if you want: [https://medium.com/@berndbausch/ssh-certificates-a45bdcdfac39](https://medium.com/@berndbausch/ssh-certificates-a45bdcdfac39)

Port forwarding to access the notebook interface would be useful in a datacenter setting if access to those ports has been firewalled away from outside computers like your laptop.

---

<div class="post-metadata">

### Author: ![jebej](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jebej/32/1784_2.png) [@jebej](https://discourse.julialang.org/u/jebej)
#### Post date: [October 22, 2020, 12:33pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765/13 "2020-10-22T12:33:43Z")

</div>

I was talking about the SSL certificates mentioned in the jupyter docs.
