{"id":15026605,"url":"https://github.com/peyton-brown/owncloud-installation-security-setup-guide","last_synced_at":"2026-03-15T17:49:32.957Z","repository":{"id":46564001,"uuid":"408937688","full_name":"peyton-brown/ownCloud-Installation-Security-Setup-Guide","owner":"peyton-brown","description":"Detailed instructions for installing and configuring an ownCloud server on Ubuntu 20.04","archived":false,"fork":false,"pushed_at":"2021-10-21T16:00:32.000Z","size":73,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T03:15:30.144Z","etag":null,"topics":["apache","apache2","mariadb","mariadb-database","mysql","mysql-database","mysqli","outlook-addin","outlook-owncloud","outlook-plugin","owncloud","owncloud-client","owncloud-outlook","owncloud-server","php","php7","php74","ubuntu","ubuntu-server","ubuntu2004"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peyton-brown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-21T18:49:06.000Z","updated_at":"2024-08-26T16:40:20.000Z","dependencies_parsed_at":"2022-09-13T11:00:59.384Z","dependency_job_id":null,"html_url":"https://github.com/peyton-brown/ownCloud-Installation-Security-Setup-Guide","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peyton-brown%2FownCloud-Installation-Security-Setup-Guide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peyton-brown%2FownCloud-Installation-Security-Setup-Guide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peyton-brown%2FownCloud-Installation-Security-Setup-Guide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peyton-brown%2FownCloud-Installation-Security-Setup-Guide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peyton-brown","download_url":"https://codeload.github.com/peyton-brown/ownCloud-Installation-Security-Setup-Guide/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243330320,"owners_count":20274039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","apache2","mariadb","mariadb-database","mysql","mysql-database","mysqli","outlook-addin","outlook-owncloud","outlook-plugin","owncloud","owncloud-client","owncloud-outlook","owncloud-server","php","php7","php74","ubuntu","ubuntu-server","ubuntu2004"],"created_at":"2024-09-24T20:04:45.736Z","updated_at":"2025-12-24T17:51:30.329Z","avatar_url":"https://github.com/peyton-brown.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ownCloud Installation \u0026 Setup Guide\nUbuntu Server 20.04 on VirtualBox VM\n\n## Prerequisite Setup\n\n### Static IP Address (If using VirtualBox, make sure Bridged Adapters are being used.)\nFor steps on setting up a static ip, use [this Linuxize guide](https://linuxize.com/post/how-to-configure-static-ip-address-on-ubuntu-20-04/#netplan).\n\n### Update Ubuntu Packages\n```\nsudo apt-get update -y \u0026\u0026 sudo apt-get upgrade -y\n```\n\n### Install Apache, PHP, MariaDB, and other Dependencies\n```\nsudo apt-get install apache2 libapache2-mod-php7.4 openssl php-imagick php7.4-common php7.4-curl php7.4-gd php7.4-imap php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-pgsql php-ssh2 php7.4-sqlite3 php7.4-xml php-redis php7.4-zip p7zip p7zip-full unrar redis-server mariadb-server mariadb-client unzip smbclient openssh-server curl wget -y; sudo apt-get remove certbot -y; sudo snap install core; sudo snap refresh core; sudo snap install --classic certbot\n```\n\n### Allow Port 443 Through Firewall \u0026 Start Apache on Startup\n```\nsudo ufw allow 'Apache Secure'\nsudo systemctl start apache2\nsudo systemctl enable apache2\nsudo systemctl status apache2\n```\n\n## Domains\nA domain will be needed for secure access outside of your network, as well as, HTTPS. I use Google Domains but any provider will work. Create a custom record inside of \"DNS\". The hostname can be any name, but for most people, the first record should be \"owncloud\". This will set the URL to *owncloud.example*.com. The type needs to be \"A\" unless you are using IPv6, in that case use \"AAAA\". The TTL default of \"3600\" is fine. For Data, enter your public IPv4 address, ***not the local Ubuntu-Server IP address***. If using IPv6, enter that instead. Do not give your public IP address to anyone you do not trust. This is why a domain is important.\n\n![Google Domains DNS Setup](https://i.imgur.com/FhMaV0c.png)\n\n## MariaDB for Database\n\n### Setup MariaDB\n```\nsudo mysql_secure_installation\n\n\tSet root password? [Y/n] y\n\t\tNew password: (any password will work)\n\tRemove anonymous users? [Y/n] y\n\tDisallow root login remotely? [Y/n] y\n\tRemove test database and access to it? [Y/n] y\n\tReload privilege tables [Y/n] y\n```\n\n### Create the ownCloud Database\n```\nsudo mysql -u root -p\n```\n\n#### Enter the following into MariaDB. Make sure you change the default password from \"qwe\" to something else.\n```\nCREATE DATABASE owncloud_db;\nGRANT ALL ON owncloud_db.* TO 'owncloud_db_user'@'localhost' IDENTIFIED BY 'qwe';\nFLUSH PRIVILEGES;\nEXIT;\n```\n\n## Download \u0026 Set Permissions for ownCloud\n\n### ownCloud [Download](https://owncloud.com/older-versions/#server)\n```\ncd /tmp\nsudo wget https://download.owncloud.org/community/owncloud-complete-20210721.zip\nsudo unzip owncloud-complete-20210721.zip -d /var/www/\n```\n\n### ownCloud Permissions\n```\nsudo chown -R www-data:www-data /var/www/owncloud/\nsudo chmod -R 755 /var/www/owncloud/\n```\n\n## Apache Configuration \n\n### Disable the Default Apache Configuration\n```\nsudo a2dissite 000-default\n```\n\n### Apache owncloud.conf File\nThis file will control how users access ownCloud content. Copy the configuation code from [owncloud.conf](https://github.com/peyton-brown/ownCloud-installation-guide/blob/main/owncloud.conf) and paste into the following file. You will need to change example.com to whichever domain name you have.\n```\nsudo vim /etc/apache2/sites-available/owncloud.conf\n```\n\n### Enable the new owncloud.conf Apache Configuration\n```\nsudo a2ensite owncloud.conf\n```\n\n### Enable Required Apache Modules\n```\nsudo a2enconf owncloud; sudo a2enmod rewrite; sudo a2enmod headers; sudo a2enmod env; sudo a2enmod dir; sudo a2enmod mime; sudo a2enmod ssl\nsudo systemctl restart apache2\n```\n\n\n## SSL / Let's Encrypt\n\n### Run this command to receive your certificate. Enter your personal information into the prompt.\n```\nsudo certbot --apache\n\n\tEnter email address (used for urgent renewal and security notices)\n \t\t(Enter 'c' to cancel): (YOUR EMAIL)\n\n\n\tPlease read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server. Do you agree?\n\t\t(Y)es/(N)o: y\n\n\n\tWould you be willing, once your first certificate is successfully issued, to\n\tshare your email address with the Electronic Frontier Foundation, a founding\n\tpartner of the Let's Encrypt project and the non-profit organization that\n\tdevelops Certbot? We'd like to send you email about our work encrypting the web,\n\tEFF news, campaigns, and ways to support digital freedom.\n\t\t(Y)es/(N)o: y\n\n\n\tWhich names would you like to activate HTTPS for?\n\t- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\t1: owncloud.example.com\n\t- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\t\tSelect the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): 1\n```\n\n### Turn on Automatic Renewal with the following command.\n```\nsudo certbot renew --dry-run; sudo systemctl restart apache2\n```\n\n[Source](https://certbot.eff.org/lets-encrypt/ubuntufocal-apache)\n\n## Finalizing the ownCloud Installation\n\n### Go to a Browser and Type URL into the Address Bar\n```\nExample: \n\thttps://owncloud.example.com/\n```\n\nEnter a Username \u0026 Password for the main adminstator\n![username and password](https://i.imgur.com/LOKsV74.png)\n\n\nSelect \"Storage \u0026 database\", select \"MySQL/MariaDB\", fill in the information, and select \"Finish setup\"\n\n![storage and database](https://i.imgur.com/PK8ooYs.png)\n\n\n## Memory Caching / Transactional File Locking\n\n### Copy the configuation code from [redis-config](https://github.com/peyton-brown/ownCloud-Installation-Security-Setup-Guide/blob/main/redis-config) and paste at the bottom of config.php. You should change the password in this file.\n```\nsudo vim /var/www/owncloud/config/config.php\n```\n\n\n## Strict Transport Security HTTP Header\n\n### Access the SSL.conf file. This should be named owncloud-ssl.conf or owncloud-le-ssl.conf\n```\nsudo vim /etc/apache2/sites-available/owncloud-le-ssl.conf\n```\n\n### Paste the following below \"ServerName\"\n```\nHeader always add Strict-Transport-Security \"max-age=15768000; includeSubDomains; preload\"\n```\n\n### Restart Apache\n```\nsudo systemctl restart apache2\n```\n\n\n## Useful Market Apps\n```\nActivity\nAnnouncement Center\nCalendar\nContacts\nCustom Groups\nE2EE File Sharing\nExtract\nFiles clipboard\nGallery\nImpersonate\nMusic\nPassword Policy\nPDF Viewer\nText Editor\nText File Viewer\nWallpaper \n\n--- \n\tDO NOT USE IF OUTLOOK PLUGIN IS OR WILL BE INSTALLED\n\t\t2-Factor Authentication  \n\t\tTwo factor backup codes\n---\n\n```\n\n\n## Backing up ownCloud\n\n### Make Backup Directory for DB \u0026 Config Files\n```\nmkdir -p /backups/owncloud/db-backups; mkdir -p /backups/owncloud/config-data\n```\n\n### Backup Config \u0026 Data Folders\n```\ncd /var/www/owncloud\nrsync -Aax config data /backups/owncloud/config-data\n```\n\n### Database Backup\nIf you changed any of the default database information (*which you should've*), you will also need to change the following.\n```\ncd /backups/owncloud/db-backups\nmysqldump --single-transaction -h localhost -u owncloud_db_user -p qwe owncloud_db \u003e owncloud-db-backup_`date +\"%Y-%m-%d\"`.bak\n```\n\n[Source](https://doc.owncloud.com/server/10.7/admin_manual/maintenance/backup.html)\n\n\n## Restoring ownCloud Backup\n\nNeeds to be added\n\n[Source](https://doc.owncloud.com/server/10.7/admin_manual/maintenance/restore.html)\n\n\n## Updating ownCloud\n\n### Review \u0026 Disable Third-Party Apps via Browser \nReview any installed third-party apps for compatibility with all new ownCloud release. Ensure that they are all disabled before beginning the upgrade.\n```\nGo to Settings -\u003e Admin -\u003e Apps and disable all third-party apps.\n```\n\n### Enable Maintenance Mode\n```\ncd /var/www/owncloud/\nsudo -u www-data php occ maintenance:mode --on\nsudo systemctl stop apache2\n```\n\n### Backup ownCloud Directories\nFollow these steps of backing up ownCloud [here](https://github.com/peyton-brown/ownCloud-Installation-Security-Setup-Guide#backing-up-owncloud).\n\n\n### Move Current ownCloud Directory\n```\nsudo mv /var/www/owncloud /var/www/owncloud_backup\n```\n\n### Download Latest Version\nDownload the latest [ownCloud server release](https://owncloud.com/older-versions/#server) to where your previous installation was (e.g. /var/www/). Replace the following url and zip name with the newest version at the time of reading.\n```\ncd /tmp; sudo wget https://download.owncloud.org/community/owncloud-complete-20210721.zip\nsudo unzip owncloud-complete-20210721.zip -d /var/www/\n```\n\n### Copy the Old Configuration Files to the Updated ownCloud Download\n```\nsudo cp -r /var/www/owncloud_backup/config/config.php /var/www/owncloud/config/config.php\n\nsudo cp -r /var/www/owncloud_backup/data /var/www/owncloud/data\n\nsudo cp -r /var/www/owncloud_backup/apps/ /var/www/owncloud/apps/\n\nsudo cp -r /var/www/owncloud_backup/apps-external/ /var/www/owncloud/apps-external/\n```\n\n### Set Permissions\n```\nsudo chown -R www-data:www-data /var/www/owncloud\n```\n\n### Start the Upgrade Process\n```\ncd /var/www/owncloud\nsudo -u www-data php occ upgrade\n```\n\nThe upgrade can take anywhere from a few seconds to a few minutes, depending on the size of your installation. When it is finished you will see either a success message or an error message that indicates why the update did not complete.\n\n### Assuming your upgrade succeeded, disable maintenance mode.\n```\nsudo -u www-data php occ maintenance:mode --off\nsudo service apache2 start\n```\n\n### Check if the Update Applied\nCheck that the version number reflects the new installation. \n```\nSettings -\u003e Admin -\u003e General.\n```\n\n[Source](https://doc.owncloud.com/server/10.7/admin_manual/maintenance/manual_upgrade.html)\n\n\n## Local External Storage / VirtualBox Shared Folder\n\nNeeds to be added\n\nhttps://tolotra.com/2018/07/28/how-to-install-ubuntu-server-on-virtualbox-with-shared-folder-and-ssh/\n\nhttps://doc.owncloud.com/server/next/admin_manual/configuration/files/external_storage/local.html\n\n\n## Outlook Intergration\n\nFor a basic overview of Outlook intergration with ownCloud, read [this](https://owncloud.com/features/outlook-plugin/).\n\nGo to the [FAQ](https://www.epikshare.com/faq/) page on epiKshare's website. This will give you all the information that is needed to get the plugin to work.\n\n```\nYou can find the download for the plugin under \"How is the Outlook plugin installed?\". \t\t\n\nClick \"Download the Outlook plugin\"\nClick ownCloud - Microsoft Outlook AddIn\nClick the three dots next to \"Office 2013 - 2016 - 2019 - O365\" and select \"Download\" \nSave the zip folder\nExtract the zip file.\nRun the .exe file and follow the prompts to install the Outlook plugin\n\nOnce finished, restart Outlook.\n```\n\nOnce Outlook has restarted, click \"ownCloud\" on the ribbon bar. Click \"Settings\" and follow the prompts. You will need to have DNS and HTTPS setup for this to work, if you do not have this, follow [Domain/DNS Setup](https://github.com/peyton-brown/ownCloud-Installation-Security-Setup-Guide/tree/production#domains) and/or [SSL/HTTPS Setup](https://github.com/peyton-brown/ownCloud-Installation-Security-Setup-Guide/tree/production#ssl--lets-encrypt). Once both are compeleted, enter your URL and click next. Select your type of authentication or if you just have none, select \"Username and Password\". Once signed-in you will need to restart Outlook for the changes to take effect. \n\nFrom here, you can change the settings to include templates, share settings, and share duration defaults. To test if the plugin is working, email yourself with an attachment. You can either drag and drope a file or by clicking \"Create Upload-Link\". The ladder is preferable as you can change settings (like share duration) individually rather than leaving it to the defaults.\n\nThis plugin is free for the first 30 days, after that you can purchase a license [here](https://oc.oem-cloud.com/en/owncloud-outlook-plugin-annual-license). \n\n```\nClick English at the top\nSelect \"Product-License\"\nChoose which plan you would like and click Next\nEnter your domain name below \"1-Year Subscription per User\", for example, https://owncloud.example.com. \n\nNote: This is the price for each email address conntected to the plugin. If you add a different email address, it will charge you the same amount as the first license (e.g. €10,00 / Year).\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeyton-brown%2Fowncloud-installation-security-setup-guide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeyton-brown%2Fowncloud-installation-security-setup-guide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeyton-brown%2Fowncloud-installation-security-setup-guide/lists"}