This section describes in detail how to use the Simple Photo Gallery command line tools.
- Start a new gallery (
- Build the gallery files (
- Publishing your gallery (
Start a new gallery (
gallery-init command is used to create a new gallery.
Folder with photos/videos
If you want to create a new gallery from a folder containing your photos you can just call it from the folder and it will create all the required files.
Note Your photos and videos are copied in
Alternatively, you can also provide a path to a folder where the photos are stored.
gallery-init -p <path/to/photos>
The script will ask you to provide some input in order to customize your gallery, like title, description, background photo or URL. You can always just press Enter to skip the question and then modify the
gallery.json file manually. See Basic Configuration for more details.
Warning: This is an experimental feature, because OneDrive and Google Photos don't officially support links to individual photos, but only to albums that can be viewed on their web sites. Therefore, your gallery may stop working at some point in time.
Note: currently only photos and no videos are supported.
You can also create a gallery from an online album on OneDrive or Google Photos (please let me know if you want support for other cloud providers). You need to create an album and get link that can be shared with other people (click on the share button).
Using an online album will not download the photos, but just create links to them.
Skip questions on the console
You can skip asking questions on the console by the script with the following parameter. In this case the defaults will be used to create the configuration.
Build the gallery files (
gallery-build command is used to create all files needed to display the gallery in the
You can directly call the
gallery-build command from a folder that contains a gallery (
Alternatively, you can also pass the path to a folder, where the gallery is located:
gallery-build -p <path/to/gallery>
--force-thumbnails can be used to trigger the generation of the thumbnails again.
In order for your HTML gallery to be updated, You should call the
gallery-build command every time that you make changes to the gallery (
gallery.json), the image descriptions (
images_data.json), HTML templates (
templates/index_template.jinja) or the photos and videos.
Publishing your gallery (
After your gallery is built, you can either upload it manually to your hosting provider or you can use one of the automatic upload options.
Uploading to Netlify
Netlify offers a free hosting plan for static websites. First, you need to create a free account on Netlify and then you can just call the
gallery-upload command from the folder containing your gallery to create a new site:
You will then need to give permissions to the Simple Photo Gallery app on Netlify to create websites for you. After that the gallery will be uploaded, a new website will be created and it will be opened in your browser. You can then log in to your Netlify account and change the website's name or link it to a custom domain.
If you want to upload to an existing site, you can specify its name or URL in the
gallery.json file as
remote_location or provide it as a parameter:
gallery-upload netlify <site_name>
Uploading the AWS S3
To use the automatic upload to AWS S3 you need to have a AWS account and to create a bucket in S3 that is publicly visible (see the AWS tutorial. You also need to setup the Amazon Command Line Interface in your environment, because the
gallery-upload command will call
aws s3 sync command.
Once your setup is done, you can call
gallery-upload aws s3://<bucket>/<path>
Alternatively, you can also put your bucket and path in the
gallery.json file under