---
title: "CloudPublish"
language: "en"
type: "Symbol"
summary: "CloudPublish[] makes a public copy in the cloud of the current document. CloudPublish[obj] makes a public copy of the cloud object obj. CloudPublish[expr] deploys an expression to the cloud and makes it public. CloudPublish[content, location] publishes to the specified location relative to the user's current cloud directory. CloudPublish[content, CloudObject[...]] publishes to the specified cloud object."
keywords: 
- notebook publishing
- computational communication
- publish to cloud
- make your own copy
- published notebook
- cloud account
- cloud basic account
- notebook archive
- rich web page
- notebook embedding
- notebook embedder
- embedded document
canonical_url: "https://reference.wolfram.com/language/ref/CloudPublish.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Cloud Functions & Deployment"
    link: "https://reference.wolfram.com/language/guide/CloudFunctionsAndDeployment.en.md"
  - 
    title: "Sharing & Embedding Content"
    link: "https://reference.wolfram.com/language/guide/SharingAndEmbeddingContent.en.md"
  - 
    title: "Cloud Permissions Control"
    link: "https://reference.wolfram.com/language/guide/CloudPermissionsControl.en.md"
  - 
    title: "Tabular Processing Overview"
    link: "https://reference.wolfram.com/language/guide/TabularProcessing.en.md"
  - 
    title: "Creating Web Pages"
    link: "https://reference.wolfram.com/language/guide/CreatingWebPages.en.md"
  - 
    title: "Tabular Communication"
    link: "https://reference.wolfram.com/language/guide/TabularCommunication.en.md"
  - 
    title: "Wolfram Resource System"
    link: "https://reference.wolfram.com/language/guide/WolframResourceSystem.en.md"
related_workflows: 
  - 
    title: "Publish a Notebook to the Cloud"
    link: "https://reference.wolfram.com/language/workflow/PublishANotebookToTheCloud.en.md"
---
# CloudPublish

CloudPublish[] makes a public copy in the cloud of the current document.

CloudPublish[obj] makes a public copy of the cloud object obj.

CloudPublish[expr] deploys an expression to the cloud and makes it public.

CloudPublish[content, location] publishes to the specified location relative to the user's current cloud directory. 

CloudPublish[content, CloudObject[…]] publishes to the specified cloud object.

## Details and Options

* ``CloudPublish`` works from both desktop and cloud.

* ``CloudPublish`` returns the ``CloudObject`` that was published.

* ``CloudPublish[expr, …]`` supports the same forms of ``expr`` as ``CloudDeploy[expr, …]``.

* ``CloudPublish`` by default adds ``All -> Automatic`` to the permissions for the published cloud object.

* ``CloudPublish`` by default adds ``AutoCopy -> True`` to the options for the published cloud object.

* ``CloudPublish`` also supports the following options:

|                        |                   |                                                                      |
| ---------------------- | ----------------- | -------------------------------------------------------------------- |
| AppearanceElements     | All               | control the page appearance                                          |
| AutoCopy               | True              | whether to make a copy when opened                                   |
| AutoRemove             | False             | whether to schedule the object for deletion                          |
| CachePersistence       | Automatic         | controls the time duration for which an object is cached by a client |
| CloudBase              | Automatic         | cloud to which to publish                                            |
| CloudObjectNameFormat  | Automatic         | format to use for the name portion of the URL                        |
| CloudObjectURLType     | Automatic         | base type of URL to use (obj, env, ...)                              |
| EvaluationPrivileges   | Automatic         | privileges of evaluations by the object                              |
| IconRules              | Automatic         | icons to use for the deployed object                                 |
| IncludeDefinitions     | True              | whether to automatically include dependencies                        |
| Magnification          | Automatic         | magnification to use for the published notebook                      |
| MetaInformation        | {}                | metainformation for the deployed object                              |
| Permissions            | {All -> Automatic} | explicit permissions for the published object                        |
| SourceLink             | Automatic         | object to be linked as the source                                    |

* With the default setting ``SourceLink -> Automatic``, ``CloudPublish`` sets the source link for the published cloud object to be the cloud object corresponding to the current notebook. If no such cloud object exists, it sets the source link to ``None``.

* With ``IncludeDefinitions -> True``, ``CloudPublish[expr, …]`` automatically deploys all definitions needed to evaluate ``expr``. With ``IncludeDefinitions -> False``, the evaluation of ``expr`` must explicitly evaluate all definitions that are needed.

* With the default setting ``Magnification -> Automatic``, ``CloudPublish`` ignores any ``Magnification`` setting in the source document and uses a 100% magnification in the published notebook. With ``Magnification -> Inherited``, the magnification of the source document is preserved.

* The Publish button in the cloud and the Publish to Cloud... menu item in desktop follow the behavior and options of ``CloudPublish``.

---

## Examples (19)

### Basic Examples (3)

Publish a ``Manipulate`` expression to a new anonymous cloud object:

```wl
In[1]:= publicObj = CloudPublish[Manipulate[Plot[Sin[x(1 + a x)], {x, 0, 6}], {a, 0, 2}]]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/3c780611-d837-4adf-aded-b46bfb2a090b"]
```

The published object has public permissions with ``AutoCopy`` set to ``True`` :

```wl
In[2]:= Options[publicObj, {Permissions, AutoCopy}]

Out[2]= {Permissions -> {"All" -> {"Read", "Interact"}, "Owner" -> {"Read", "Write", "Execute"}}, AutoCopy -> True}
```

---

Publish an expression with a name:

```wl
In[1]:= CloudPublish[Manipulate[Plot[Sin[x(1 + a x)], {x, 0, 6}], {a, 0, 2}], "SineExample"]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/documentation/SineExample"]
```

---

Create a private object:

```wl
In[1]:= obj = CloudDeploy[MatrixPlot[ExampleData[{"Matrix", "FIDAP007"}]], "MatrixPlot", Permissions -> "Private"]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/documentation/MatrixPlot"]
```

Publish a copy of the private object:

```wl
In[2]:= published = CloudPublish[obj, "Published/FinalPlot"]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/documentation/Published/FinalPlot"]
```

Confirm that the copied object has public permissions:

```wl
In[3]:= Options[published, Permissions]

Out[3]= {Permissions -> {"All" -> {"Read", "Interact"}, "Owner" -> {"Read", "Write", "Execute"}}}
```

### Scope (3)

Publish a notebook:

```wl
In[1]:= nb = Notebook[{Cell["head", "Section"], Cell["text", "Text"]}];

In[2]:= CloudPublish[nb]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/acac89c1-c186-4652-88a8-d0d7914b64a6"]
```

---

Publish a notebook object:

```wl
In[1]:= nbObject = CreateDocument[{1, x, x ^ 2}];

In[2]:= CloudPublish[nbObject]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/ee22f085-ac19-4710-ac8b-7428692cfa4e"]
```

---

Publish an API function:

```wl
In[1]:= CloudPublish[APIFunction[{}, DateList[]&]]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/d72c4a16-be68-42fa-bb4a-81485d784103"]
```

### Options (12)

#### AppearanceElements (1)

Create an object without any appearance elements:

```wl
In[1]:= obj  = CloudPublish[GeoGraphics[Entity["City", {"Washington", "DistrictOfColumbia", "UnitedStates"}]], "DC", AppearanceElements -> None]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/documentation/DC"]
```

Embed the object into a separate HTML page:

```wl
In[2]:=
CloudPublish[
	ExportForm[
	"<!DOCTYPE html>"  <> EmbedCode[obj]["CodeSection"]["Content"], "HTML"], "EmbeddedGraphics.html"]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/documentation/EmbeddedGraphics.html"]
```

#### AutoCopy (1)

Do not set ``AutoCopy`` during ``CloudPublish`` :

```wl
In[1]:= obj = CloudPublish[14!, AutoCopy -> False]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/4b834e60-07ce-4613-8e9c-a3f04ef08857"]

In[2]:= Options[obj, AutoCopy]

Out[2]= {AutoCopy -> False}
```

#### AutoRemove (1)

Publish a computed value to a temporary object:

```wl
In[1]:= obj = CloudPublish[42!, AutoRemove -> True]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/68b560ff-bc9d-4223-90ab-d01fe382d26c"]

In[2]:= Options[obj, AutoRemove]

Out[2]= {AutoRemove -> True}
```

#### CloudBase (1)

Specify a ``CloudBase`` during ``CloudPublish`` :

```wl
In[1]:= CloudPublish[RandomImage[], "Fuzzy", CloudBase -> "https://www.wolframcloud.com"]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/documentation/Fuzzy"]
```

#### CloudObjectNameFormat (1)

Create a named cloud object and use ``\$CloudUserUUID`` for the ``CloudObjectNameFormat`` :

```wl
In[1]:= CloudPublish[42, "nameFormatByUserUUID.wl", CloudObjectNameFormat -> "CloudUserUUID"]

Out[1]=
CloudObject["https://www.wolframcloud.com/obj/user-b0c28e9f-876d-4478-9d8b-9e7d18a9ea81/nameFormatB\
yUserUUID.wl"]
```

Create a named cloud object and use ``\$CloudUserID`` for the ``CloudObjectNameFormat`` :

```wl
In[2]:= CloudPublish[RandomImage[], "nameFormatByUserID", CloudObjectNameFormat -> "CloudUserID"]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/documentation@wolfram.com/nameFormatByUserID"]
```

#### CloudObjectURLType (1)

Publish a cloud object with a link to its editing environment view as specified by ``CloudObjectURLType`` :

```wl
In[1]:= CloudPublish[GeoGraphics[Entity["City", {"Jakarta", "Jakarta", "Indonesia"}]], CloudObjectURLType -> "Environment"]

Out[1]= CloudObject["https://www.wolframcloud.com/env/23b4a0ac-534e-4b44-bfe8-22f37dda23ca"]
```

Publish a cloud object with a link to its deployed object view:

```wl
In[2]:= CloudPublish[GeoGraphics[Entity["City", {"Milan", "Lombardy", "Italy"}]], CloudObjectURLType -> "Object"]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/d4ae1b64-1ef1-4c75-ad62-065ada536062"]
```

#### IconRules (1)

Publish a cloud object that shows the current time, with a representative icon:

```wl
In[1]:= obj = CloudPublish[Delayed[ClockGauge[], "PNG", UpdateInterval -> 5], IconRules -> ClockGauge["10:10"]]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/d59c843e-bd39-4cc0-97f4-84452d0569b8"]
```

View the icon:

```wl
In[2]:= Options[obj, IconRules]

Out[2]= {IconRules -> {"FileBrowser" -> [image], "IOS" -> [image]}}
```

#### IncludeDefinitions (1)

Exclude definitions associated with the published expression from the current kernel session; instead, load the definitions from a file during evaluation:

```wl
In[1]:=
geoGraphFunc[x_] := GeoGraphics[x];
CloudSave[geoGraphFunc, "GeoGraphImage.m"];

In[2]:= api = CloudPublish[APIFunction[{"loc" -> "City"}, (CloudGet["GeoGraphImage.m"];geoGraphFunc[#loc])&], IncludeDefinitions -> False]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/911cd580-7dc5-4877-8d8f-ce19a0f09e93"]

In[3]:= URLExecute[api, {"loc" -> "Scranton"}]

Out[3]= [image]
```

#### Magnification (1)

Preserve the magnification of the source document during ``CloudPublish`` :

```wl
In[1]:= obj = CloudPublish[Notebook[{Cell["head", "Section"], Cell["text", "Text"]}, Magnification -> 2], Magnification -> Inherited]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/13320efc-098a-4e06-b923-3767f2bb5f27"]

In[2]:= Options[CloudGet[obj], Magnification]

Out[2]= {Magnification -> 2}
```

#### MetaInformation (1)

Add custom metainformation to a published image:

```wl
In[1]:= obj = CloudPublish[[image], MetaInformation -> <|"Description" -> "Golden Egg"|>]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/d5ee0e3a-513f-4233-ab10-e1c1ec222d3a"]

In[2]:= Options[obj, MetaInformation]

Out[2]= {MetaInformation -> {"Description" -> "Golden Egg"}}
```

#### Permissions (1)

``Permissions`` provides a way to restrict access to a specific user or group of users.

Create a new ``PermissionsGroup``. Add more users by adding their ``\$CloudUserID`` to the list:

```wl
In[1]:= CreatePermissionsGroup["mygroup", {$CloudUserID}]

Out[1]= PermissionsGroup["https://www.wolframcloud.com/obj/documentation/PermissionsGroup/mygroup"]
```

Use ``CloudPublish`` to publish any object with the specified access permissions:

```wl
In[2]:= obj  = CloudPublish[20!, Permissions -> PermissionsGroup["mygroup"] -> {"Read", "Write"}]

Out[2]= CloudObject["https://www.wolframcloud.com/obj/0ff91671-5dc8-4923-a626-fe1b46b0a1ed"]
```

Check the permissions:

```wl
In[3]:= Options[obj, Permissions]

Out[3]= {Permissions -> {"Owner" -> {"Read", "Write", "Execute"}, PermissionsGroup["https://www.wolframcloud.com/obj/c062f7d1-472c-441f-98da-ba732d02c8f2"] -> {"Read", "Write"}}}
```

#### SourceLink (1)

Do not set a source link during ``CloudPublish`` :

```wl
In[1]:= obj = CloudPublish[12!, SourceLink -> None]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/b8f1c265-a1fd-4458-bced-469a3b139cf8"]

In[2]:= Options[obj, SourceLink]

Out[2]= {SourceLink -> None}
```

### Properties & Relations (1)

``CloudPublish`` is equivalent to ``CloudDeploy`` with automatic ``Permissions`` for all users and ``AutoCopy`` enabled:

```wl
In[1]:= obj = CloudDeploy[Manipulate[Plot[Sin[x(1 + a x)], {x, 0, 6}], {a, 0, 2}]]

Out[1]= CloudObject["https://www.wolframcloud.com/obj/42acce48-1295-42b4-a38a-c219738286c4"]

In[2]:= SetOptions[obj, Permissions -> All -> Automatic, AutoCopy -> True]

Out[2]= {Permissions -> All -> Automatic, AutoCopy -> True}
```

## See Also

* [`CloudDeploy`](https://reference.wolfram.com/language/ref/CloudDeploy.en.md)
* [`CloudShare`](https://reference.wolfram.com/language/ref/CloudShare.en.md)
* [`Permissions`](https://reference.wolfram.com/language/ref/Permissions.en.md)
* [`AutoCopy`](https://reference.wolfram.com/language/ref/AutoCopy.en.md)
* [`ExportForm`](https://reference.wolfram.com/language/ref/ExportForm.en.md)
* [`EmbedCode`](https://reference.wolfram.com/language/ref/EmbedCode.en.md)
* [Publish to Cloud](https://reference.wolfram.com/language/ref/menuitem/PublishToCloud.en.md)

## Related Guides

* [Cloud Functions & Deployment](https://reference.wolfram.com/language/guide/CloudFunctionsAndDeployment.en.md)
* [Sharing & Embedding Content](https://reference.wolfram.com/language/guide/SharingAndEmbeddingContent.en.md)
* [Cloud Permissions Control](https://reference.wolfram.com/language/guide/CloudPermissionsControl.en.md)
* [Tabular Processing Overview](https://reference.wolfram.com/language/guide/TabularProcessing.en.md)
* [Creating Web Pages](https://reference.wolfram.com/language/guide/CreatingWebPages.en.md)
* [Tabular Communication](https://reference.wolfram.com/language/guide/TabularCommunication.en.md)
* [Wolfram Resource System](https://reference.wolfram.com/language/guide/WolframResourceSystem.en.md)

## Related Workflows

* [Publish a Notebook to the Cloud](https://reference.wolfram.com/language/workflow/PublishANotebookToTheCloud.en.md)

## Related Links

* [Wolfram Notebook Embedder](http:reference.wolfram.com/language/WolframNotebookEmbedder/)

## History

* [Introduced in 2015 (10.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn102.en.md) \| [Updated in 2019 (12.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn120.en.md) ▪ [2020 (12.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn121.en.md)