RemoteEvaluate[expr]
gives the result of evaluating expr using your current default remote Wolfram Language kernel.
RemoteEvaluate[ker, expr]
gives the result of evaluating expr using the kernel specified by ker.
RemoteEvaluate[{ker1,ker2,…},expr]
gives a list of the results of evaluating expr using each of the kernels keri.
RemoteEvaluate[ker,expr,h]
wraps the head h around the result produced before returning it.
RemoteEvaluate
RemoteEvaluate[expr]
gives the result of evaluating expr using your current default remote Wolfram Language kernel.
RemoteEvaluate[ker, expr]
gives the result of evaluating expr using the kernel specified by ker.
RemoteEvaluate[{ker1,ker2,…},expr]
gives a list of the results of evaluating expr using each of the kernels keri.
RemoteEvaluate[ker,expr,h]
wraps the head h around the result produced before returning it.
Details and Options
- RemoteEvaluate has attribute HoldAll.
- RemoteEvaluate[expr] uses the kernel given by $DefaultRemoteKernel.
- RemoteEvaluate has the following option:
-
IncludeDefinitions True whether to automatically include dependencies - With IncludeDefinitionsTrue, definitions required for the evaluation of expr will automatically be sent to the remote kernel.
- With IncludeDefinitions->False, definitions required for the evaluation of expr must be loaded and evaluated explicitly during the evaluation of expr.
- Kernels are specified using KernelConfiguration, or short string forms.
- The following remote kernel string forms are recognized:
-
"ssh://user@hostname:port/path" a kernel on the given machine, accessed using SSH "ssh://hostname" use the default path, user and port on the given machine "hostname" equivalent to "ssh://hostname" "wstp://server:port/pool" a kernel on a WSTPServer "wstp://server" use the default port and kernel pool "Local" the default local kernel "localhost" a kernel on the same machine "file:///path/to/wolfram" the given kernel on the same machine "https://www.wolframcloud.com/" a kernel in the Wolfram Cloud LinkObject[…] a WSTP link to a running kernel - The path in "ssh://hostname/path" or "file:///path" is the absolute path of a suitable kernel command.
- SSH cannot ask for passwords interactively. Keys can be specified, or an SSH password agent can be used.
Examples
open all close allBasic Examples (3)
Connect to a machine with SSH, launch a default kernel and evaluate some of its properties:
RemoteEvaluate["ssh://byblis67.wolfram.com", {$MachineName, $ProcessID, $Version}]Connect to a WSTPServer on the given port:
RemoteEvaluate["wstp://raspi4b:31415", {$MachineName, $ProcessID, $Version}]Use a cloud kernel for evaluation:
RemoteEvaluate[$CloudBase, $Version]Run the evaluation in a kernel on the same machine:
RemoteEvaluate["localhost", {$MachineName, $ProcessID, $Version}]{$MachineName, $ProcessID, $Version}Each instance of RemoteEvaluate launches a new kernel, which is discarded after the evaluation:
RemoteEvaluate["localhost", $ProcessID]RemoteEvaluate["localhost", $ProcessID]The same evaluation can be performed on several kernels:
RemoteEvaluate[{"localhost", "ssh://vega", "wstp://raspi4b:31415", "https://www.wolframcloud.com/"}, {$MachineName, $VersionNumber}]Scope (15)
SSH Kernels (6)
Use the default SSH port and remote kernel command:
RemoteEvaluate["ssh://vega", {$MachineName, First[$CommandLine]}]Specify an absolute path to the remote kernel command:
RemoteEvaluate["ssh://byblis67.wolfram.com/usr/local/Wolfram/WolframEngine/12.0.1-6580411/Executables/wolfram", {$MachineName, First[$CommandLine]}]Specify an absolute path to the default kernel command on macOS:
RemoteEvaluate["ssh://mac.example.com//Applications/Mathematica.app/Contents/MacOS/wolfram", {$OperatingSystem, First[$CommandLine]}]Specify the remote operating system to choose a suitable kernel command:
RemoteEvaluate[KernelConfiguration["ssh://mac.example.com", "OperatingSystem" -> "MacOSX"], {$OperatingSystem, First[$CommandLine]}]Specify a username on the remote machine:
RemoteEvaluate["ssh://user@vega", {$MachineName, $Username}]A bare host name is assumed to be an SSH kernel:
RemoteEvaluate["vega", $MachineName]WSTPServer Kernels (3)
Connect to a WSTPServer listening on the default port and request a kernel in the default pool:
RemoteEvaluate["wstp://raspi4b", {$MachineName, $Version}]Connect to a WSTPServer listening on the given port:
RemoteEvaluate["wstp://raspi4b:31415", {$MachineName, $Version}]Connect to a WSTPServer and request a kernel in the given pool:
RemoteEvaluate["wstp://raspi4b/KernelPoolOne", {$MachineName, $Version}]Cloud Kernels (2)
Local Kernels (3)
Connect to a kernel on the same machine where the request is made:
RemoteEvaluate["localhost", {$MachineName, $ProcessID}]{$MachineName, $ProcessID}Use a specific local kernel, given by its absolute path:
RemoteEvaluate[KernelConfiguration["localhost", "KernelCommand" -> "/usr/local/bin/wolfram132"], $Version]Alternatively, give the path in the URL:
RemoteEvaluate["file:///usr/local/bin/wolfram132", $Version]Use a specific local kernel, given by its relative path:
RemoteEvaluate[KernelConfiguration["localhost", "KernelCommand" -> "wolfram132"], $Version]Link Kernels (1)
Generalizations & Extensions (1)
A result received is normally evaluated further on the receiving side:
var = 42;RemoteEvaluate["localhost", Clear[var];var]Prevent the evaluation of the result received by wrapping it in Hold:
RemoteEvaluate["localhost", Clear[var];var, Hold]Options (1)
IncludeDefinitions (1)
By default, necessary definitions for an evaluation are sent to the remote kernel:
var = 42;f[x_] := x ^ varRemoteEvaluate["localhost", f[2], Hold]Without these definitions, no evaluation takes place on the remote kernel:
RemoteEvaluate["localhost", f[2], Hold, IncludeDefinitions -> False]Properties & Relations (3)
Use the kernel given by $DefaultRemoteKernel:
RemoteEvaluate[$MachineName]$DefaultRemoteKernelLocalEvaluate works like RemoteEvaluate, but uses the kernel given by $DefaultLocalKernel:
LocalEvaluate[$MachineName]$DefaultLocalKernelParallelEvaluate performs the same computation on all running parallel subkernels:
ParallelEvaluate[$ProcessID]RemoteEvaluate performs the same computation on all kernels specified:
RemoteEvaluate[{"localhost", "localhost", "ssh://vega"}, $ProcessID]Neat Examples (2)
Perform a parallel computation on a remote machine:
RemoteEvaluate["arcturus", ParallelEvaluate[$ProcessID]]Perform an evaluation that requires a front end, which is launched on the remote machine as needed:
RemoteEvaluate["ssh://vega", Rasterize[$MachineName]]Related Guides
History
Text
Wolfram Research (2020), RemoteEvaluate, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoteEvaluate.html.
CMS
Wolfram Language. 2020. "RemoteEvaluate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RemoteEvaluate.html.
APA
Wolfram Language. (2020). RemoteEvaluate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RemoteEvaluate.html
BibTeX
@misc{reference.wolfram_2026_remoteevaluate, author="Wolfram Research", title="{RemoteEvaluate}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RemoteEvaluate.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_remoteevaluate, organization={Wolfram Research}, title={RemoteEvaluate}, year={2020}, url={https://reference.wolfram.com/language/ref/RemoteEvaluate.html}, note=[Accessed: 13-June-2026]}