Install Nextcloud on Windows with WSL2
i12bretro
learningtechnologyapacheapache httpdbrowser basedcloud solutiondebianfree softwarehome labhome lab ideashow tohow to install wslhttpdi12bretroinstall guidelamplinuxlinux on windowsmariadbmysqlnextcloudphpphp applicationphp softwareself-hostedsubsystemtutorialweb basedweb based toolsweb serverwindowswindows subsystem for linuxwslwsl installation guide
#Nextcloud #Windows #Linux
Full steps can be found at https://i12bretro.github.io/tutorials/0151.html
What is Nextcloud?
Nextcloud is an open source, self-hosted file share and communication platform. Access & sync your files, contacts, calendars & communicate and collaborate across your devices. You decide what happens with your data, where it is and who can access it! -[https://docs.nextcloud.com/](https://docs.nextcloud.com/)## Installing WSL
- Launch Powershell as administrator
- Run the following command
# enable WSL feature
dism.exe /online /enable‐feature /featurename:Microsoft‐Windows‐Subsystem‐Linux /all /norestart
# enable virtual machine platform
dism.exe /online /enable‐feature /featurename:VirtualMachinePlatform /all
- Type Y to reboot the system
- Launch Powershell as administrator and run the following additional commands to use WSL 2
# enable virtualization platform
Enable‐WindowsOptionalFeature ‐Online ‐FeatureName VirtualMachinePlatform
# enable wsl2
wsl ‐‐set‐default‐version 2
# download the wsl kernel update
$ProgressPreference = 'SilentlyContinue'; Invoke‐WebRequest https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi ‐OutFile .\wsl_update_x64.msi
# reset progress preference
$ProgressPreference = 'Continue'
# install the downloaded file
.\wsl_update_x64.msi
- Click the Start Button > Search Microsoft Store > Select Microsoft Store
- Search for the Linux distribution to install (Debian, Ubuntu, etc), Debian in this example
- Select the Linux distribution and click the Get button
- After the Linux distribution downloads and installs, click Open or select the distribution from the Start menu to launch it
- Input a username and password to be used in the Linux environment
Installing Nextcloud
- Continue with the following commands in WSL
# update software repositories
sudo apt update
# install software updates
sudo apt upgrade ‐y
# install prerequisite packages
sudo apt install unzip wget ‐y
# install Apache HTTPD and MySQL
sudo apt install apache2 mariadb‐server mariadb‐client ‐y
# install PHP components
sudo apt install php7.4 libapache2‐mod‐php7.4 php7.4‐mysql php‐common php7.4‐cli php7.4‐common php7.4‐json php7.4‐opcache php7.4‐readline php7.4‐intl php7.4‐json php7.4‐gd php7.4‐mbstring php7.4‐mysql php7.4‐xml php7.4‐zip php7.4‐curl ‐y
# start the mariadb service
sudo service mariadb start
# configure the MySQL database
sudo su
mysql_secure_installation
- Press Enter to login as root
- Type N and press Enter to not switch to socket authentication
- Type Y and press Enter to set a root password, type the password twice to confirm
- Type Y and press Enter to remove anonymous users
- Type Y and press Enter to disallow root login remotely
- Type Y and press Enter to remove the test database
- Type Y and press Enter to reload privilege tables
- Run the following command to login into MySQL:
mysql ‐u root ‐p
- Authenticate with the root password set earlier
- Run the following commands to create the Nextcloud database and database user
CREATE DATABASE nextclouddb;
GRANT ALL ON nextclouddb.* to 'nextcloud_rw'@'localhost' IDENTIFIED BY 'N3xtCl0ud!';
FLUSH PRIVILEGES;
EXIT;
exit
- Continue with the following commands to download and extract Nextcloud in the Apache webroot
# download latest nextcloud version
wget ‐O /tmp/nextcloud.zip https://download.nextcloud.com/server/releases/latest.zip
# extract downloaded nextcloud archive
sudo unzip ‐q /tmp/nextcloud.zip ‐d /var/www
# set the owner of the new nextcloud directory to www‐data
sudo chown ‐R www‐data:www‐data /var/www/nextcloud
# create a new nextcloud.conf file to configure the site
sudo nano /etc/apache2/sites‐available/nextcloud.conf
- Paste the following configuration into nextcloud.conf
Alias /nextcloud "/var/www/nextcloud/"
<directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
Dav off
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</directory>
- Press CTRL+O, Enter, CTRL+X to write the changes to nextcloud.conf
....Full steps can be found on GitHub [link at the top]
### Connect with me and others ###
★ Discord: https://discord.com/invite/EzenvmSHW8
★ Reddit: https://reddit.com/r/i12bretro
★ Twitter: https://twitter.com/i12bretro
...
https://www.youtube.com/watch?v=W4AjWkWnETU
2023-05-15
0.0 LBC
Copyrighted (contact publisher)
46726485 Bytes