Installing and upgrading


To install and use Twyne, you need the following software on your web server:

  1. a web server with PHP 7.3 or above;

  2. MariaDB (10.3 or above) or MySQL (5.7 or above)

  3. command-line access to that server;

  4. the Git version control system;

  5. the PHP package manager, Composer;

  6. ExifTool for working with embedded photo metadata; and

  7. ImageMagick for creating multiple sizes of images.


First, clone the latest version of the source code into a non web-accessible location on your server:

git clone /var/www/twyne

Create a new database and grant access to it to a new user. Add the details of this database and the user’s credentials to the .env.local file in the DATABASE_URL key:


Then install the application with the included script, which checks out the latest version and installs all dependencies with Composer:

/var/www/twyne/bin/ prod /var/www/twyne

Next, set up your web server to serve the public/ directory as the root of the new web site. For Apache, this could be something like the following:

<VirtualHost *:80>
    RewriteRule ^/(.*)$$1 [L,R=permanent,QSA]
<VirtualHost *:80>
    RewriteRule ^/(.*)$$1 [L,R=permanent,QSA]
<VirtualHost *:443>
    DocumentRoot /var/www/twyne/public/
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    <Directory "/var/www/twyne/public/">
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]

Where is replaced by your own domain name.

Your new Twyne site should now be live. Navigate to the home page, and continue the set-up process as detailed in the Configuration section of this manual.


Upgrading is as simple as re-running the script. This will checkout the latest version of the code, install dependencies, and update the database as required. This script can be run automatically on a daily or weekly basis (as a Cronjob or Scheduled Task, for instance).

Prior to Twyne 0.30.0, location data was not read from any uploaded files that had GPS data in them (i.e. usually photographs). To retrospecively add this data, run

./bin/console twyne:extract-gps