diff --git a/tasks/install.yml b/tasks/install.yml
index eb2b8e7c225bb73b9b3678eb130d8967dc6b6b2e..c390c32d884fea12913032d9d0a8f810b41eb713 100644
--- a/tasks/install.yml
+++ b/tasks/install.yml
@@ -191,6 +191,8 @@
     login_password: '{{ mysql_root_password|default("root") }}'
     login_host: '127.0.0.1'
     login_port: '{{ nextcloud.db_port|default("3306") }}'
+    collation: 'utf8mb4_general_ci'
+    encoding: 'utf8mb4'
     state: 'present'
   with_items:
     - 'nextcloud'
diff --git a/templates/config.php.jinja2 b/templates/config.php.jinja2
index 354b5f8ce306e4eaa1f844cf2481392523210600..16d2c9dcd77c69c98896f107fdec459e68464526 100644
--- a/templates/config.php.jinja2
+++ b/templates/config.php.jinja2
@@ -53,4 +53,5 @@ $CONFIG = array (
   'htaccess.RewriteBase' => '/',
   'memcache.local' => '\\OC\\Memcache\\Redis',
   'memcache.locking' => '\\OC\\Memcache\\Redis',
+  'mysql.utf8mb4' => true,
 );