diff --git a/config/config.sample.php b/config/config.sample.php
index 8f5b1a2cee3565cdc2e16288a30f8891f0052bc3..8595c024e4c1d8d5c372ecf00c2d716a2d200f85 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -1226,13 +1226,13 @@ $CONFIG = array(
 			'password' => 'swift',
 			'domain' => [
 				'name' => 'default',
-			]
+			],
 		],
 		'tenantName' => 'service',
 		'serviceName' => 'swift',
 		'region' => 'regionOne',
 		'url' => "http://yourswifthost:5000/v3",
-		'bucket' => 'nextcloud'
+		'bucket' => 'nextcloud',
 	],
 ],
 
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php
index 4451fbcc750ec402cf0ee2080aad2e8be79422d6..f22e147445b4203e23d1548b54c92085515603f3 100644
--- a/lib/private/Files/ObjectStore/Swift.php
+++ b/lib/private/Files/ObjectStore/Swift.php
@@ -62,6 +62,10 @@ class Swift implements IObjectStore {
 	 * @return string the container name where objects are stored
 	 */
 	public function getStorageId() {
+		if (isset($this->params['bucket'])) {
+			return $this->params['bucket'];
+		}
+
 		return $this->params['container'];
 	}
 
diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php
index eab3441ff2cf51d866e2619dffe0f6e34115ae4c..7bb76782a82d0f35f512c2cd7d25f29085a5a44f 100644
--- a/lib/private/Files/ObjectStore/SwiftFactory.php
+++ b/lib/private/Files/ObjectStore/SwiftFactory.php
@@ -77,7 +77,7 @@ class SwiftFactory {
 			$this->params['container'] = $this->params['bucket'];
 		}
 		if (!isset($this->params['container'])) {
-			$this->params['container'] = 'owncloud';
+			$this->params['container'] = 'nextcloud';
 		}
 		if (!isset($this->params['autocreate'])) {
 			// should only be true for tests
@@ -95,7 +95,7 @@ class SwiftFactory {
 			$this->params['tenantName'] = $this->params['tenant'];
 		}
 
-		$cacheKey = $userName . '@' . $this->params['url'] . '/' . $this->params['bucket'];
+		$cacheKey = $userName . '@' . $this->params['url'] . '/' . $this->params['container'];
 		$token = $this->getCachedToken($cacheKey);
 		$hasToken = is_array($token) && (new \DateTimeImmutable($token['expires_at'])) > (new \DateTimeImmutable('now'));
 		if ($hasToken) {