Immich stands out as a robust self-hosted solution for managing your cherished photos and videos, offering a refreshing alternative to cloud-based services. If you're looking to transition your local media collection into Immich without relying on external services like Google Photos or Amazon Photos, you've come to the right place. This guide will walk you through the various methods to import your existing pictures and videos, ensuring a smooth and efficient transition.
Immich provides several pathways for importing local media, each suited to different scenarios and user preferences. The primary methods include utilizing the Immich web interface, setting up external libraries, and leveraging powerful command-line interface (CLI) tools. Understanding these methods is crucial for choosing the most effective approach for your specific needs.
For smaller sets of photos or videos, the Immich web interface offers a straightforward upload mechanism. While convenient, it might not be the most efficient for bulk imports due to browser limitations and potential timeouts for large files.
The simplest way to add a few new photos or videos is directly through the Immich web application. This method is intuitive but generally not recommended for large-scale migrations.
Steps:
One of Immich's most powerful features for local imports is the ability to integrate external libraries. This method allows Immich to scan and index media files stored outside its primary upload directory, letting you maintain your existing folder structure on your server without duplicating files.
External libraries are perfect if you already have an organized collection of photos and videos on your server and want Immich to manage them without moving the original files. Immich will track these assets and display them in your timeline, treating them like any other asset.
Prerequisites:
Steps:
docker-compose.yml
file. For example, if your photos are in /mnt/media/photos
on your host, you might add a line like:
services:
immich-server:
volumes:
- /mnt/media/photos:/usr/src/app/external_photos:ro # 'ro' for read-only to prevent accidental modifications
Replace /mnt/media/photos
with the actual path on your host and /usr/src/app/external_photos
with your desired path within the container. Make sure to use forward slashes (/
).
/usr/src/app/external_photos
). Click "Add" and then "Save" the new path.Immich will load and create corresponding assets for all files in the specified path. It's important to note that Immich will not modify the original files in external libraries. All edited metadata is saved in companion .xmp
sidecar files and the database.
The radar chart above visually compares the strengths of different Immich import methods. As you can see, each method excels in different areas, allowing you to choose the best fit for your specific importing needs. External libraries offer a strong balance between efficiency and maintaining your existing file organization, while CLI tools provide unparalleled control for bulk operations.
For large-scale imports, particularly when migrating an entire existing photo and video archive, the Immich Command Line Interface (CLI) and the community-maintained Immich-Go utility are the most efficient tools. These tools offer robust features for bulk uploads, deduplication, and metadata handling.
The Immich CLI allows you to perform various actions from the command line, including uploading assets. It's particularly useful for bulk imports where you need more control than the web UI offers.
This video demonstrates the capabilities of the Immich CLI, including instant album creation and efficient photo migration. It highlights how the CLI can streamline the process of uploading large historical image libraries to your Immich server, making it an invaluable tool for users with extensive collections.
Installation and Setup:
Before you can use the Immich CLI, you need to install it and authenticate with your Immich server.
# Install the Immich CLI (ensure you have Node.js and npm installed)
npm install -g @immich/cli
# Authenticate with your Immich server
# Replace your-immich-url and your-api-key
immich login --server http://your-immich-url --key your-api-key
Bulk Uploading Files:
Once authenticated, you can upload files from a local directory. The --recursive
flag is essential for including subfolders, and the --album
flag can automatically create albums based on folder names.
# Example: Upload all photos and videos from a directory and create albums
immich upload /path/to/your/photos --recursive --album
# To skip hashing files before upload (Immich still performs its own deduplication)
immich upload /path/to/your/photos --recursive --skip-hash
# Including hidden folders
immich upload /path/to/your/photos --recursive --include-hidden
Immich performs deduplication through hashing, so you don't need to worry about uploading the same file multiple times. The --skip-hash
option is merely a performance consideration.
Immich-Go is a community-maintained alternative to the Immich CLI, written in Go, offering similar and extended functionalities, especially for handling Google Photos Takeout archives. While your query specifies local files, Immich-Go's from-folder
subcommand is highly relevant for robust local imports.
Key Features of Immich-Go's from-folder
subcommand:
KeepRaw
, StackCoverRaw
).tag1/subtag1
).Example Usage with Immich-Go:
# Example: Upload photos from a folder, recursively, and create albums from subfolders
./immich-go from-folder --recursive --album /path/to/your/local/archive
# Example: Import files within a specific date range and add tags
./immich-go from-folder --recursive --date "2023-01-01:2023-12-31" --tag "vacation/2023" /path/to/vacation_photos
Immich-Go is particularly powerful for complex import scenarios where fine-grained control over metadata, tagging, and file handling is required.
To ensure your import process is as seamless as possible, keep the following considerations in mind:
While Immich can process files regardless of their organization, having a consistent structure can simplify management, especially if you plan to use features like automatic album creation from folder names (with the CLI). Immich also allows setting storage templates to define how uploaded files are organized on disk.
Aspect | Description | Best Practice / Immich Feature |
---|---|---|
Original File Integrity | Immich does not modify original files; metadata edits are saved in sidecar files. | Immich keeps originals untouched. |
Deduplication | Immich automatically hashes files to prevent duplicates, even if uploaded multiple times. | Built-in hashing mechanism. Use --skip-hash for performance on CLI if sure of uniqueness. |
Metadata Handling | Immich extracts metadata from files and supports XMP sidecar files. | Ensure files have correct metadata; Immich-Go can help with missing dates. |
Folder Structure | Immich can import folders into albums, but its native library display is timeline-based. | Use Immich CLI/Immich-Go --album flag to convert folders to albums. |
File Locations | Immich stores uploaded files in a managed library folder and generates transcoded versions and thumbnails. External libraries are tracked but not managed by Immich. | Configure UPLOAD_LOCATION in docker-compose.yml for managed files. Use external libraries for existing, unmanaged collections. |
Large Imports | Web UI can struggle with large numbers of files; CLI/Immich-Go are more robust. | Utilize Immich CLI or Immich-Go for bulk uploads. |
Error Handling | Check Immich logs and CLI output for errors during import. Ensure correct path mapping for external libraries. | Verify Docker volume mounts and container access. Run docker exec -it immich_server bash to check paths. |
After initiating a large import, especially via external libraries or CLI, monitor your Immich server's logs to ensure assets are being processed correctly. Common issues include incorrect path mappings in Docker volumes or permissions problems preventing Immich from accessing the files.
docker-compose.yml
match the paths configured in the Immich UI. You can verify Immich's access by running a shell inside the container (docker exec -it immich_server bash
) and checking if you can ls
the import path..xmp
files and its database.This image illustrates the Immich backup and import process, emphasizing the flow of media into the Immich system. It highlights the importance of a well-defined import strategy for managing your self-hosted photo and video collection effectively.
Once your media is imported, Immich offers various features to help you organize and enjoy your collection:
.xmp
sidecar files and in the Immich database. Immich also generates transcoded versions and thumbnails for compatibility and performance.--album
flag during the upload process. This feature allows Immich to automatically create albums based on the names of your local folders, effectively preserving your organizational structure within Immich.Importing your local pictures and videos into Immich is a straightforward process, whether you're adding a few new files or migrating an entire historical archive. By leveraging Immich's web interface for quick uploads, external libraries for managing existing file structures, or the powerful CLI tools for bulk imports and advanced control, you can seamlessly integrate your media into your self-hosted solution. Immich's commitment to data integrity and its rich feature set make it an excellent choice for anyone looking to take control of their personal media collection.