PhotoCraft Web: Self-Host the WebAssembly Build
What the PhotoCraft web (WASM) build is, how to host photocraft-web.zip and its split wasm parts on any static server or Docker, browser needs and limits.
PhotoCraft's whole engine and interface also compile to WebAssembly. Each release ships them as photocraft-web-<ver>.zip, a static website you can host on any web server, with no backend. Images are opened and edited on the visitor's own device and are never uploaded. The table above links the zip from the official GitHub release. To try the web build without hosting anything, open the online editor right here. Like the desktop app, the web build is early alpha.
What's in the zip
The zip contains one folder, photocraft-web-<ver>/. Since v0.10.0 the app's WebAssembly no longer ships as one .wasm file: it is gzipped and cut into parts in an app/ folder, and a small boot module puts them back together in the browser. v0.23.1 has:
| File | What it is | Size in v0.23.1 |
|---|---|---|
index.html | The page. It loads everything through relative URLs. Since v0.21.0 it also holds a hidden "PhotoCraft stopped" message (see Memory), which is why it grew from 2,527 bytes in v0.20.1 | 3,544 bytes |
photocraft-web-boot-<hash>_bg.wasm | The boot module, which downloads the parts, inflates them and starts the app | 102,668 bytes |
photocraft-web-boot-<hash>.js | The boot module's wasm-bindgen glue (an ES module) | 26,999 bytes |
app/photocraft-web-<hash>.part-aa (-ab, … if needed) | The app's WebAssembly, gzipped and cut into parts of at most 20 MiB. v0.23.1 needs only one part. | 15,955,518 bytes (15.2 MiB) |
app/parts.txt | The list of parts, in order | 59 bytes |
app/photocraft-web.js | The app's wasm-bindgen glue | 181,948 bytes |
snippets/eframe-<hash>/inline0.js | A small JavaScript helper the app's glue imports, new in v0.17.0. In the release zips it sits at the top of the site, not in app/, which stops the app from starting (see below) | 280 bytes |
_headers, .htaccess | Sample header rules for Netlify / Cloudflare Pages and for Apache | |
README.md, HOSTING.md | The project README and the hosting notes (a copy of packaging/web/README.md) | |
LICENSE-MIT, LICENSE-APACHE | The licences | |
NOTICE, ATTRIBUTION.md | Copyright notices and third-party attributions, new in v0.18.0 | |
fonts/ (not in the zip) | Optional fonts a host adds itself, listed in fonts/manifest.txt (see Serving extra fonts) |
The whole v0.23.1 zip is 16,064,050 bytes (15.3 MiB). Inflated, the part is the app's 39,345,058-byte (37.5 MiB) .wasm, 7,506,351 bytes (7.2 MiB) more than v0.21.0's. The other files in the zip are the same size as in v0.21.0, apart from index.html, which is 4 bytes smaller. The hosting notes in the zip still quote sizes measured on 13 October 2026 for version 0.8.2. Since v0.7.0 the web build leaves the JPEG XL decoder for DNG files out of the wasm to save space (#2233), so DNGs that use JPEG XL compression open only in the desktop app.
Why it changed. Cloudflare Pages and Workers reject any single file over 25 MiB, and the release script used to fail if the .wasm grew past 24 MiB. By v0.9.0 the app was only about 130 KiB under that gate, and the gate kept blocking changes to the code (#5302). #5941, merged for v0.10.0, ships the wasm as compressed parts behind the boot module instead. The release script now fails only if a file in the site is over 24 MiB, and the app itself may be bigger. It is, by a growing margin: the v0.23.1 .wasm is 14,179,234 bytes over 24 MiB and 13,130,658 bytes over Cloudflare's 25 MiB cap, so it couldn't ship there as a single file. Yet the largest file in the site is the 15.2 MiB part, still one part, about 4.8 MiB under the 20 MiB a part may hold. So the old 24 MiB gate no longer limits the app. The boot module fetches the parts in order and inflates them as they arrive, so the browser still compiles the app while it downloads. Browsers inflate the parts natively, and a browser without DecompressionStream (Safari before 16.4, Firefox before 113) gets inflation in the boot module's own code, a little slower. A plain trunk build from source, or the Docker image below, still produces a single .wasm, for hosts without a size cap.
Known issue: v0.17.0 to v0.23.1 don't start
The official web zips from v0.17.0 to v0.23.1 (v0.17.0, v0.18.0, v0.19.0, v0.20.1, v0.20.2, v0.21.0, v0.22.0, v0.23.0 and v0.23.1) don't start on any server: the page stays on "Loading PhotoCraft…". The app's glue, app/photocraft-web.js, imports ./snippets/eframe-<hash>/inline0.js, which the browser looks for at app/snippets/…. The zip has that file only at snippets/…, at the top of the site, so the request gets a 404, or index.html from a host that answers unknown paths with it, which the browser refuses to run as a module. The packaging script copies the app's glue into app/ but not the snippets the glue needs; the boot module's build, which also lands at the top of the site, carries the copy that is there. The packaging script is unchanged from v0.19.0 to v0.23.1, and so is the problem: on 12 November 2026 the v0.23.1 zip's app/photocraft-web.js still imports ./snippets/eframe-d31a8450ea12dfc1/inline0.js, and snippets/ is still only at the top. We reproduced it with the unmodified v0.18.0 zip, and on 3 November 2026 with the unmodified v0.20.1 zip on a plain static server, where Chromium got a 404 for app/snippets/eframe-d31a8450ea12dfc1/inline0.js and stayed on the loading screen.
Upstream reports: #10017, #10092, #10487, #10491 and #10590, On 5 November 2026 a maintainer closed #10092, #10487, #10491 and #10590 as duplicates of #10017, which is still open on 12 November. The fix, #10248, ships the snippets in app/ and checks at packaging time that every snippet the glue imports is there. A maintainer reviewed it on 1 November without approving it, and it was still not merged on 12 November, after v0.23.1 shipped without it. v0.16.0 and earlier aren't affected.
Unofficial workaround. Reporters in #10487 and #10590, and the description of #10248, copy the snippets folder into app/ after unzipping. #10590 gives the command and says 0.18.0 then starts normally. We checked that the v0.20.1 zip starts this way too:
cd photocraft-web-0.23.1
cp -r snippets app/
This is not an official fix. It adds a copy of one 280-byte file and changes nothing else, but your site then no longer matches the release zip file for file. Keep the copy at the top too, because index.html preloads it from there. With your own _headers or .htaccess, app/snippets/… falls under the same rules as the other hashed files. In #10092, others instead edit the three imports at the top of app/photocraft-web.js to ../snippets/…, which also changes a release file. A later release with #10248 merged won't need either.
Self-host it in four steps
-
Download
photocraft-web-<ver>.zipandSHA256SUMS.txtfrom the release, and check the zip:sha256sum -c --ignore-missing SHA256SUMS.txt # Linux shasum -a 256 photocraft-web-0.23.1.zip # macOS: compare with SHA256SUMS.txt -
Unzip it and try it locally:
unzip photocraft-web-0.23.1.zip cd photocraft-web-0.23.1 python3 -m http.server 8765Open http://localhost:8765/.
localhostcounts as a secure context, so WebGPU works here. The v0.17.0 to v0.23.1 zips stay on the loading screen until you apply the workaround above. -
Upload the folder's contents, including the
app/folder, to any static host: nginx, Apache, Caddy, an S3-style bucket behind a CDN, Netlify, or Cloudflare Pages. Every URL is relative, so it works at a domain root (https://example.com/) or under a path (https://example.com/tools/photocraft/) without rebuilding. When you upgrade, replace the whole folder, becauseapp/parts.txtnames the parts of its own release. -
Check it: open the page, open an image, and save or export it.
Server settings that matter
- MIME type: serve
.wasmasapplication/wasmand.jsastext/javascript. With the wrong type, browsers can't stream-compile the wasm, and the app loads slowly or not at all. For nginx, make suremime.typeshasapplication/wasm wasm;. - Serve the parts as they are: the
app/*.part-*files are gzip data already, and the page inflates them. Serve them byte for byte, withoutContent-Encoding. Their extension is one servers don't know, so the usualapplication/octet-streamwith no compression is right. - Apache with
mod_mime_magic: that module recognises the gzip inside a part and sends it withContent-Encoding: x-gzip, so the browser inflates it on the way in. v0.10.0 then failed to start with a "Failed to read from a ReadableStream" error (#7639, closed), and v0.11.1 has the same code. v0.12.0 notices a part that is already inflated and uses it as it is (#7683). The hosting notes add that this holds while the app ships as one part, as it does now, because such a server labels only the part that starts with gzip's header. - Missing files must be 404s: a host that answers every unknown path with
index.html(a single-page-app fallback) hides a failed or partial upload. PhotoCraft notices and says the download failed, but a 404 is clearer in the server's logs. - Compression: turn on gzip or Brotli for
.wasm,.jsand.html. It matters much less than before, since the parts are already compressed. It shrinks the two.jsfiles and the small boot module. - Caching: files whose names carry a hash (the parts and
photocraft-web-boot-<hash>.*) can haveCache-Control: public, max-age=31536000, immutable.index.html,app/photocraft-web.jsandapp/parts.txtkeep their names from release to release, so give themno-cache. The bundled_headersand.htaccessdo exactly this. - HTTPS: WebGPU and the clipboard only work in a secure context (
https://orhttp://localhost). Over plain HTTP elsewhere, the app falls back to WebGL2. - No isolation headers needed: PhotoCraft doesn't use
SharedArrayBuffer, so you don't need COOP/COEP. If your site already sends COEPrequire-corp, also sendCross-Origin-Resource-Policyon the app's files.
The nginx example from the project's hosting guide (the first matching location wins, so the files that keep their names come first):
location /photocraft/ {
types { application/wasm wasm; text/javascript js; text/html html; }
gzip on;
gzip_types application/wasm text/javascript text/html;
location ~* (index\.html|app/photocraft-web\.js|app/parts\.txt)$ { add_header Cache-Control "no-cache"; }
location ~* (\.(wasm|js)|\.part-[a-z]+)$ { add_header Cache-Control "public, max-age=31536000, immutable"; }
}
On Netlify, Cloudflare Pages or Apache, the bundled _headers and .htaccess files cover the same ground. They have no rules for fonts, which you add yourself (see below).
Serving extra fonts
The web build has only two fonts of its own, Inter and JetBrains Mono: a browser doesn't let a page use the fonts installed on the computer, and embedding more would make the wasm bigger. The official zip has no fonts/ folder, so the font menus offer just those two unless the host adds more. The Fonts section of the zip's HOSTING.md explains how:
- Put
.ttf,.otfor.ttcfiles anywhere under afonts/folder next toindex.html, each with its licence file next to it (the SIL Open Font License, for one, requires that). - List them in
fonts/manifest.txt, one file per line, in the format of the craft-fonts repository's own manifest:family | style | file, optionally followed byscripts | licence | licence file | sha256 | source.familymust be the font's own family name, and the path is relative to the site root and can't leave it. A variable font is one line. - Serve
fonts/manifest.txtwithCache-Control: no-cacheso edits show up,.ttfasfont/ttfand.otfasfont/otf, with compression. The app downloads the files withfetch()from its own origin, so a Content Security Policy has to allow them underconnect-src.
For example (the file names are only an illustration):
# family | style | file | scripts | licence | licence file
Open Sans | Regular | fonts/open-sans/OpenSans[wdth,wght].ttf
Noto Sans SC | Regular | fonts/noto-sans-sc/NotoSansSC-Regular.otf | Hans | OFL-1.1 | fonts/noto-sans-sc/OFL.txt
The families appear in the font menus straight away, and a family's files are downloaded only the first time it is picked or a document's text needs it. When a line has a SHA-256, the browser rejects a file with any other content. Without fonts/manifest.txt (a 404) nothing changes.
The scripts field matters for writing that the two built-in fonts don't cover. The first family listed for a script such as Hans (Simplified Chinese), Hant, Jpan, Kore, Arab, Hebr or, since v0.23.0, Geor (Georgian, #8812) becomes that script's fallback, for text in documents and, going by the v0.23.1 source, for the interface as well: the app fetches it up front for the browser's languages and the interface language. So a host that serves a Chinese font marked Hans should be able to show the Chinese interface that otherwise draws empty boxes (#1615). The same goes for the Georgian interface that arrived in v0.22.0: the desktop builds draw it with craft-fonts' Noto Sans Georgian or an installed Georgian font, but the web zip has no Georgian font, so a host has to serve one marked Geor. We haven't tried this, and this site's online editor serves no extra fonts yet.
Hosting with Docker
The repository has a Dockerfile that builds the web app from source and serves it with nginx on port 8080. The project labels this recipe community-maintained: CI doesn't build it and releases don't use it, so it can lag behind the official zip. From a clone of the repository:
docker build --load -t photocraft-web:local .
docker run -d --name photocraft-web --restart unless-stopped \
-p 8080:8080 photocraft-web:local
Then open http://localhost:8080/. The first build takes several minutes. For a public deployment, put an HTTPS reverse proxy in front of it, and bind it to loopback (-p 127.0.0.1:8080:8080) when the proxy runs on the same host. The hosting guide covers build arguments and serving under a sub-path.
Embedding in another page
PhotoCraft fills whatever iframe you put it in:
<iframe
src="https://example.com/photocraft/"
title="PhotoCraft image editor"
style="width: 100%; height: 720px; border: 0;"
allow="fullscreen; clipboard-read; clipboard-write"
allowfullscreen>
</iframe>
A sandboxed iframe needs at least allow-scripts allow-same-origin allow-downloads allow-popups. Without allow-downloads, Save and Export are blocked. Without allow-same-origin, the page gets an opaque origin and Chrome refuses it browser storage, so preferences can't be saved and brush presets last only for the session. Since v0.9.0 the warning about unsaved brush presets appears only once you actually change a preset, instead of sitting above the canvas from the start (#4918). It follows the frame's size, so size the iframe, not the app. Keyboard shortcuts reach it once the user clicks into the frame, as with any embedded app, and the renderer flags below work on the iframe's src too, for example https://example.com/photocraft/?webgl. A cross-origin embed works, but browsers that partition or block third-party storage may forget its preferences between visits, and it then starts with defaults. Don't send X-Frame-Options: DENY from the PhotoCraft host, or a frame-ancestors Content Security Policy that leaves out the page that embeds it.
Browser requirements
You need a browser with WebGPU or WebGL2. PhotoCraft renders with wgpu: it uses WebGPU when the browser has it and falls back to WebGL2 on its own. A browser with neither gets a message instead of the app. Add a flag to the URL to override the choice:
| URL | Effect |
|---|---|
| (no flag) | WebGPU if available, otherwise WebGL2 |
?webgl | Force WebGL2, useful when a WebGPU driver misbehaves |
?cpu | Force the CPU canvas (slowest, most compatible) |
?free-mb=N | Diagnostics only, new in v0.21.0: the memory checks and the low-memory warning below act as if only N MiB were free |
Memory. A browser tab gives the app at most 4 GiB of memory, and phones often much less. When the tab ran out, earlier versions froze on the last frame and the document was lost without a word. Since v0.21.0, Place, Image Size, re-rendering a smart object and Save first check that the memory they need is free. If it isn't, they refuse with an error that names the operation and the estimated need, and the document stays as it was. While a document is open, a notice that stays until you dismiss it warns when less than 512 MiB is left, so you can still save. If the app runs out anyway, or hits an internal error, the page now shows PhotoCraft stopped with a Reload link instead of freezing; changes since the last save in that tab can't be recovered (#10129). Since v0.20.2, opening a native .pcraft document in the browser is capped at 512 MiB per embedded block and 1 GiB of decompressed data in total, so a bigger document fails to open instead of exhausting the tab (#10984). And since v0.21.0, placing a large PNG no longer freezes the page: the work runs in slices of about 8 ms per frame, with progress in the status bar (#10164).
Touch screens. On phones and tablets, such as Android Chrome, menus and dropdowns opened once and then only showed their hover state, because the browser reported each tap twice and the second press closed the menu the first had opened. Since v0.13.0 the web build drops that duplicate press, so menus open on every tap (#6910, fixing #2095).
Web build vs desktop
| Web | Desktop | |
|---|---|---|
| Opening files | Browser file picker (since v0.7.0, File › Open opens every file you select: #2802). PDFs don't open: the web build answers "PDF import needs the desktop build" | Native dialogs, drag and drop, file associations. Since v0.22.0 also PDF pages, rendered as artboards (#11647) |
| Saving | Save and Export download a file | Writes to disk |
| Autosave and crash recovery | None, so save often. Since v0.6.0, the page asks before you close or reload it with unsaved work (#1424) | Yes |
| Preferences | Browser localStorage (may be forgotten in third-party iframes) | Settings folder |
| Pen pressure and tilt | Yes, via Pointer Events | Pressure, tilt and rotation on macOS and Linux X11 (#255); on Windows pressure through Windows Ink, with the eraser end since v0.22.0 (#11684), plus tilt with the opt-in WinTab mode since v0.21.0 (#11331); native Wayland not yet (#2622) |
| Chinese, Japanese and Korean interface | Not out of the box: the zip has no CJK font, so the text shows as empty boxes (#1615, still open on 12 November 2026). A host that serves a CJK font should be able to fix that (see Serving extra fonts); otherwise use English | Yes, with Japanese UI fonts embedded in release builds |
| Updates | No check: Help › Check for Updates is unavailable, so watch the release page | A check once per launch and from the Help menu since v0.16.0 (in the Flatpak since v0.18.0); since v0.17.0 most install types can update themselves after you confirm |
CLI, MCP server, --control channel | Not available | Available |
The web build is a good way to try PhotoCraft, or to give a team an editor without installing anything. For day-to-day work, the Windows, macOS or Linux app adds crash recovery, native file access, the CLI and a working Chinese, Japanese or Korean interface. If the page stays blank, check the browser requirements above and try the ?webgl or ?cpu flag.
Use it here or host it yourself
photocraft.im is an unofficial community guide. Its online editor runs an unmodified copy of the official web build, served from this site's own storage. Since 12 November 2026 that is v0.23.1. To get round the known issue without changing the build, this site doesn't copy or edit any file. When the browser asks for app/snippets/… and the release has no such file, the site answers with the release's own snippets/… file from the top of the zip, byte for byte. Every file the editor loads is one from the official zip. The PhotoCraft project itself doesn't host an official online copy yet. Publishing one at an official URL is requested in #1655, still open on 12 November 2026. That page shows which version it runs and the SHA-256 of the release zip it comes from, so you can check it against the official SHA256SUMS.txt.
To host it yourself, still download the web zip from the official storytold/photocraft GitHub releases and check it against SHA256SUMS.txt, as in step 1 above.
Treat any "online PhotoCraft" run by an unknown third party with care. Before you open private images in one, check that it says which version it runs and gives a checksum you can match against the official release, that it serves the build unchanged, and that it adds no ads or trackers inside the editor. Without that, you have no way to know which build it serves or how it was changed.