diff --git a/NEXTCLOUD.cmake b/NEXTCLOUD.cmake
index 80e48b533..7cc321c14 100644
--- a/NEXTCLOUD.cmake
+++ b/NEXTCLOUD.cmake
@@ -6,6 +6,7 @@ set( APPLICATION_VENDOR     "Nextcloud GmbH" )
 set( APPLICATION_UPDATE_URL "https://updates.nextcloud.org/client/" CACHE string "URL for updater" )
 set( APPLICATION_HELP_URL   "" CACHE string "URL for the help menu" )
 set( APPLICATION_ICON_NAME  "Nextcloud" )
+set( APPLICATION_SERVER_URL "" CACHE string "URL for the server to use. If entered the server can only connect to this instance" )
 
 set( LINUX_PACKAGE_SHORTNAME "nextcloud" )
 
diff --git a/config.h.in b/config.h.in
index 55c5f619a..3805dc235 100644
--- a/config.h.in
+++ b/config.h.in
@@ -20,6 +20,7 @@
 #cmakedefine APPLICATION_UPDATE_URL "@APPLICATION_UPDATE_URL@"
 #cmakedefine APPLICATION_HELP_URL "@APPLICATION_HELP_URL@"
 #cmakedefine APPLICATION_ICON_NAME "@APPLICATION_ICON_NAME@"
+#cmakedefine APPLICATION_SERVER_URL "@APPLICATION_SERVER_URL@"
 #cmakedefine APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR "@APPLICATION_WIZARD_HEADER_BACKGROUND_COLOR@"
 #cmakedefine APPLICATION_WIZARD_HEADER_TITLE_COLOR "@APPLICATION_WIZARD_HEADER_TITLE_COLOR@"
 #cmakedefine APPLICATION_WIZARD_USE_CUSTOM_LOGO "@APPLICATION_WIZARD_USE_CUSTOM_LOGO@"
diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp
index 4f306c38f..f68b61e2e 100644
--- a/src/libsync/theme.cpp
+++ b/src/libsync/theme.cpp
@@ -244,7 +244,11 @@ QString Theme::conflictHelpUrl() const
 
 QString Theme::overrideServerUrl() const
 {
+#ifdef APPLICATION_SERVER_URL
+    return QString::fromLatin1(APPLICATION_SERVER_URL);
+#else
     return QString();
+#endif
 }
 
 QString Theme::forceConfigAuthType() const