Docker Installation and update

Modified on Wed, 2 Dec at 4:20 PM

This article explains how to install the Newired Portal with Docker Compose and how to update an existing Docker installation to a new version. It applies to Newired Portal 27.0.0.

Note – upgrading from 26.x or lower?
Since version 27.0.0 the object storage (screenshots, media library) runs on Garage instead of MinIO. Upgrading from 26.x or lower requires a one-time data migration. Follow the Update to a new version section carefully and do not skip the object storage migration.

Contents

Prerequisites

  • Docker Engine 25.x or later, installed and running.
  • The license file newired.license.
  • SSH access to the host machine with sudo privileges.
  • At least 60 GB of free disk space.
  • Free ports: 8090 (HTTP) and 8443 (HTTPS).
  • The Newired Docker package (images and docker-compose.yml), downloaded from download.newired.com.

Installation

1. Import the Docker images

docker load < newired-portal-27.0.0.tar
docker load < newired-object-storage-27.0.0.tar
docker load < newired-database-27.0.0.tar

2. Add the license file

Copy your license file newired.license into the same folder as docker-compose.yml.

3. Edit docker-compose.yml

  1. Set the public domain name in the environment variable NEWIRED_DOMAIN (used for internal application settings only).
  2. Set the admin password.
  3. Set the SMTP configuration.
  4. Set the object storage credentials. The values must match between the two services:
    • GARAGE_DEFAULT_SECRET_KEY (object-storage service) = NEWIRED_STORAGE_ACCESS_SECRET (portal service)
    • GARAGE_DEFAULT_ACCESS_KEY (object-storage service) = NEWIRED_STORAGE_ACCESS_KEY (portal service)
    The secret key must be at least 16 characters long.
  5. Configure licensing. The next step depends on your license type.

License based on MAC address

Set the MAC address from your newired.license file:

portal:
  networks:
    nw_network:
      mac_address: AA:BB:CC:DD:EE:11

License based on fingerprint

Change the portal network property from:

portal:
  networks:
    nw_network:
      # mac_address: xx:xx:xx:xx:xx:xx

to:

portal:
  networks:
    - nw_network

Then set the SSH connection properties as environment variables of the portal service. We recommend using a dedicated account.

environment:
  - HOST_SSH_PORT=<port>
  - HOST_SSH_USER=<user name>
  - HOST_SSH_PASSWORD=<password>

4. Start the application

docker-compose up -d

5. Open the Portal

Open http://localhost:8090 or https://localhost:8443 in your browser.

Note – HTTPS
The HTTPS certificate included with the installation is self-signed. For production use we recommend a reverse proxy with your own certificate. See Setting up HTTPS on Newired application server (CentOS/RedHat) and Reverse proxy for Newired.

Recommended: log settings

By default, Docker does not limit the size of container logs, and the Portal writes its application logs inside the container. Over time this can fill the disk. We recommend adding the following settings to docker-compose.yml on every installation.

Portal service – send application logs to the console and log errors only:

portal:
  environment:
    - SPRING_PROFILES_ACTIVE=console
    - LOGGING_LEVEL_ROOT=ERROR

All services (portal, database, object-storage) – enable Docker log rotation:

logging:
  driver: json-file
  options:
    max-size: "50m"
    max-file: "5"

Apply the changes with:

docker-compose up -d --force-recreate

A plain restart does not apply these settings; the containers must be recreated.

Update to a new version

Database upgrades run automatically (Flyway migration) when the new version starts, so no manual database import is needed. A full backup before upgrading is still essential.

Warning – back up first
Before upgrading, back up the database and the ./object-storage folder (see Backup). Check that the backup files exist and are not empty, and that docker-compose.yml uses a persistent volume for the database.

1. Stop the application

docker-compose down

2. Import the new Docker images

docker load < newired-portal-27.0.0.tar
docker load < newired-object-storage-27.0.0.tar
docker load < newired-database-27.0.0.tar

3. Update docker-compose.yml

Change the image version of each service:

image: newired-portal:27.0.0
...
image: newired-database:27.0.0
...
image: newired-object-storage:27.0.0
Warning – upgrading from 26.x or lower
Replace the whole object-storage service with the one from the new docker-compose.yml, set the object storage credentials (see Installation, step 3.4), and complete the object storage migration before starting the application. This also applies when upgrading directly from 25.x: the migration script reads the old MinIO data format directly, so no intermediate upgrade is needed.

4. Start the application

docker-compose up -d

Object storage migration (MinIO → Garage)

Required only when upgrading from 26.x or lower. Fresh installations do not need it.

Garage cannot read the MinIO data directory, so the data is copied through the S3 API by the script upgrade-object-storage/minio-to-garage/migrate.sh, included in the package. The script:

  • starts the old MinIO and the new Garage side by side on an isolated Docker network (no host ports),
  • copies every bucket and object, keeping object keys, content type and metadata,
  • compares object count and size per bucket and fails if anything is missing,
  • renames the MinIO data folder from ./object-storage to ./object-storage-minio, so Garage uses ./object-storage,
  • can be re-run safely (objects already copied are skipped),
  • never deletes anything from the MinIO data.

Before you start

  • Free disk space at least equal to the size of ./object-storage (the data exists twice until the old folder is removed). Check the size with du -sh object-storage.
  • The MinIO image of your current installation is still loaded (docker images newired-minio).
  • The new images are loaded (see Update to a new version, step 2).
  • Plan downtime: the application must stay stopped during the migration. The duration depends on the amount of data.

1. Stop the application and back up the object storage

docker-compose down
tar czf object-storage-backup.tar.gz object-storage

2. Update docker-compose.yml

Update the file to the new version (see Update to a new version, step 3). Set the same access key and secret (minimum 16 characters) in GARAGE_DEFAULT_ACCESS_KEY / GARAGE_DEFAULT_SECRET_KEY of the object-storage service and in NEWIRED_STORAGE_ACCESS_KEY / NEWIRED_STORAGE_ACCESS_SECRET of the portal service.

3. Run the migration

Use the MinIO image version of your current installation and the Garage credentials from step 2:

cd upgrade-object-storage/minio-to-garage
MINIO_IMAGE=newired-minio:<current-version> \
GARAGE_ACCESS_KEY=<GARAGE_DEFAULT_ACCESS_KEY> \
GARAGE_SECRET_KEY=<GARAGE_DEFAULT_SECRET_KEY> \
./migrate.sh

If your data is stored in other locations, set them with MINIO_DATA_DIR and GARAGE_DATA_DIR (the data is then not moved).

A successful run ends with output similar to:

migrate-1  | BUCKET        MINIO OBJECTS  GARAGE OBJECTS  MINIO BYTES  GARAGE BYTES
migrate-1  | media                     1               1     30000000      30000000
migrate-1  | screenshot               50              50          341           341
migrate-1  | MIGRATION VERIFIED - all buckets and objects are present in Garage.
Important
If the script prints MIGRATION VERIFICATION FAILED or exits with an error, do not start the application. Fix the cause (see Troubleshooting) and run the script again.

4. Start the application and check your content

docker-compose up -d

Open a Tip with screenshots and the media library, and upload a new media file to confirm everything works.

5. Remove the old MinIO data

Warning – permanent deletion
Only run this step once you have confirmed that all content is available in the Portal. The commands below permanently delete the old MinIO data and the backup; after this, rollback is no longer possible.
rm -rf object-storage-minio object-storage-backup.tar.gz
docker image rm newired-minio:<current-version>

Rollback

The MinIO data in ./object-storage-minio stays untouched until step 5. To roll back:

docker-compose down
rm -rf object-storage
mv object-storage-minio object-storage

Then restore your previous docker-compose.yml and image versions and start the application. The migration can be retried from scratch at any time.

Backup

  • Database: take a full backup before every upgrade and keep the database on a persistent volume, as defined in docker-compose.yml.
  • Object storage: all Garage data and metadata are stored in ./object-storage. Back it up while the object-storage service is stopped.

Troubleshooting

Flyway checksum mismatch after an upgrade

If the application does not start after an upgrade and the log shows an error similar to:

FlywayValidateException: Migration checksum mismatch for migration version X.Y.Z

add the FLYWAY_REPAIR_UP_TO_VERSION environment variable to the portal service:

portal:
  environment:
    - FLYWAY_REPAIR_UP_TO_VERSION=26.0.0.1

Flyway repairs the checksum history automatically on the next startup. After a successful start, remove the variable from docker-compose.yml. If you are unsure which value to use, contact Newired Support.

Object storage errors

MessageCause and solution
Secret keys should be at least 16 characters longGARAGE_DEFAULT_SECRET_KEY is too short. Use at least 16 characters.
Access key ... is associated with a secret key different than the one givenThe secret in docker-compose.yml differs from the one used when the Garage data in ./object-storage was created. Use the original secret, or remove ./object-storage and run the migration again (the MinIO data stays in ./object-storage-minio).
Portal logs SignatureDoesNotMatch or InvalidAccessKeyIdThe portal credentials (NEWIRED_STORAGE_ACCESS_*) do not match the Garage credentials (GARAGE_DEFAULT_*). Make them identical.
MinIO data directory ... is missing or emptyThe script expects the MinIO data in ./object-storage (or ./object-storage-minio after the first run). If the data is elsewhere, set MINIO_DATA_DIR.
MinIO data directory ... also contains Garage data (meta/, data/)The application was started with Garage before the migration. Stop it, remove the meta and data folders from the MinIO data directory, and run the migration again.

More object storage logs

The object-storage service logs warnings and errors only. To log every S3 request, add RUST_LOG=garage=info to its environment section and recreate the service.

Still need help?

Our technical team is available to assist with installations and upgrades. Contact Newired Support and include your Portal version, the relevant part of docker-compose.yml (with passwords and keys removed), and the output of docker-compose logs --tail 200 portal.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article