# Running Julia on remote machine

**URL:** <https://discourse.julialang.org/t/running-julia-on-remote-machine/55578>\
**Category:** New to Julia\
**Created:** [February 18, 2021, 10:03pm UTC](https://discourse.julialang.org/t/running-julia-on-remote-machine/55578 "2021-02-18T22:03:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lancejnelson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lancejnelson/32/21898_2.png) [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Post date:** [February 18, 2021, 10:03pm UTC](https://discourse.julialang.org/t/running-julia-on-remote-machine/55578/1 "2021-02-18T22:03:05Z")

</div>

Frequently I run code on a remote machine which means executing at the command line. But every time I run a code in Julia it’s going to recompile everything and so it takes longer. Is there a way to remember the compiled stuff from a previous execution so it’s faster the second time like it is when I run in the REPL?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 18, 2021, 10:07pm UTC](https://discourse.julialang.org/t/running-julia-on-remote-machine/55578/2 "2021-02-18T22:07:27Z")

</div>

> **[GitHub - dmolina/DaemonMode.jl: Client-Daemon workflow to run faster scripts...](https://github.com/dmolina/DaemonMode.jl)**
>
> Client-Daemon workflow to run faster scripts in Julia - GitHub - dmolina/DaemonMode.jl: Client-Daemon workflow to run faster scripts in Julia

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [February 18, 2021, 11:47pm UTC](https://discourse.julialang.org/t/running-julia-on-remote-machine/55578/3 "2021-02-18T23:47:30Z")

</div>

> Frequently I run code on a remote machine which means executing at the command line.

Why not using ssh capable editors like vscode or emacs ? If the CLI is mandatory, you may use PackageCompiler.

---

<div class="post-metadata">

**Author:** ![lancejnelson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lancejnelson/32/21898_2.png) [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Post date:** [February 19, 2021, 12:01am UTC](https://discourse.julialang.org/t/running-julia-on-remote-machine/55578/4 "2021-02-19T00:01:26Z")

</div>

> [@LaurentPlagne](#):
>
> Why not using ssh capable editors like vscode or emacs ?

Good idea, but two-factor authentication makes that more challenging.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 19, 2021, 12:06am UTC](https://discourse.julialang.org/t/running-julia-on-remote-machine/55578/5 "2021-02-19T00:06:45Z")

</div>

Can’t you leave the REPL running at the server? If you use gnu-screen or tmux you can even logout and leave it there.

---

<div class="post-metadata">

**Author:** ![felipenoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/felipenoris/32/553_2.png) [@felipenoris](https://discourse.julialang.org/u/felipenoris)\
**Post date:** [February 19, 2021, 1:04am UTC](https://discourse.julialang.org/t/running-julia-on-remote-machine/55578/6 "2021-02-19T01:04:26Z")

</div>

This is a common issue. If you can’t keep the session open on the remote machine, you’ll have to use PackageCompiler.jl to build a custom system image, which basically serializes a session to a file. Or, you could wait for Julia v1.6, which does a much better job on JIT latency.

---

<div class="post-metadata">

**Author:** ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Post date:** [February 19, 2021, 7:36am UTC](https://discourse.julialang.org/t/running-julia-on-remote-machine/55578/7 "2021-02-19T07:36:21Z")

</div>

The easiest solution for me is to say into the headless machine which has byobu+tmux installed and then run emacs in the terminal in one of the byobu windows (are they called windows?). This wil work as long as you can ssh into the machine and the session stays open independent of connection.
