Tool to import Google Photos Takeout into Nextcloud
  • PHP 97.2%
  • Dockerfile 2.8%
Find a file
2026-05-28 11:49:14 +02:00
.github/workflows Update release.yml 2026-05-28 11:49:14 +02:00
docker increase disk cache size 2025-05-27 13:46:17 +02:00
nbproject initial 2025-01-27 15:57:25 +01:00
src Merge branch 'main' into feat-live-photos 2026-05-05 13:48:42 +02:00
.gitignore Add release build steps and update deps 2026-05-28 10:02:17 +02:00
cliff.toml Switch changelog generation to git-cliff 2026-05-28 10:44:00 +02:00
composer.json Add release build steps and update deps 2026-05-28 10:02:17 +02:00
composer.lock Add release build steps and update deps 2026-05-28 10:02:17 +02:00
Dockerfile Merge branch 'main' into infra-improvements 2026-05-05 13:50:25 +02:00
gp2nc.php Add release build steps and update deps 2026-05-28 10:02:17 +02:00
LICENSE Initial commit 2025-01-27 10:29:53 +01:00
README.md Improve dockerfile/readme 2026-03-14 12:01:10 +02:00

Google Photos to Nextcloud

Requires Nextcloud Photos app to be installed, because of albums.

Replace NEXTCLOUD_URL with the following: https://<USER>:<APP_PASSWORD>@nextcloud.example.org/Photos, /Photos can be any path in Nextcloud to import photos to

Optionally, setting a NEXTCLOUD_PREFIX allows nextcloud to be in a sub dir.

# nextcloud url: https://web.hos.st/nextcloud
NEXTCLOUD_PREFIX=nextcloud # no leading or trailing /!

Command Line

Run from command line (in /path/to/Takeout/Google Photos, where photo directories and jsons are residing)

Note: Imagick extension required (with ffmpeg for video exif data)

NEXTCLOUD_URL=<NEXTCLOUD_URL> # e.g. https://user:s3cr3t@cloud.example.com/Photos
NEXTCLOUD_USER=usernamehere # Optional, overwrites user in NEXTCLOUD_URL
NEXTCLOUD_PASSWORD=secret # Optional, overwrites password in NEXTCLOUD_URL
php gp2nc.php

Run with docker

/path/to/Takeout/Google Photos is the path where the general json files (e.g. user-generated-memory-titles.json) of your Takeout reside.

docker build . -t gp2nc
docker run --rm -v "/path/to/Takeout/Google Photos":/photos -e NEXTCLOUD_URL=<NEXTCLOUD_URL> gp2nc

or use pre-built image from GitHub Container Registry (auto-build)

docker run --rm -v "/path/to/Takeout/Google Photos":/photos -e NEXTCLOUD_URL=<NEXTCLOUD_URL> ghcr.io/rikmeijer/googlephotos2nextcloud:latest

Known errors

Disk cache limit is set to 32GiB, files requiring larger cache will exhaust this and result in an error like:

Failed reading metadata: cache resources exhausted

If you like this tool

Donations are welcome