The Ultimate Home File/Media Server Setup on Ubuntu Server
Вставка
- Опубліковано 28 жов 2022
- In this video, I show you how to set up a home file/media server using Nextcloud on Ubuntu Server.
Links:
Ubuntu Server ISO: ubuntu.com/download/server
Commands:
Run commands from another computer: ssh [username]@[IP address] (example: ssh drew@192.168.0.157)
Check for updates: sudo apt update
Install updates: sudo apt upgrade
Install Nextcloud: sudo snap install nextcloud
Enable HTTPS (using a self-signed certificate): sudo nextcloud.enable-https self-signed
Edit Collabora configuration file: sudo nano /var/snap/nextcloud/current/nextcloud/extra-apps/richdocumentscode/proxy.php
Edit Nextcloud configuration file: sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php
Restart the server: sudo shutdown now -r
Shut down the server: sudo shutdown now
*If you want to do more configuration with Nextcloud, check out the documentation for the Nextcloud snap here:
github.com/nextcloud-snap/nex... - Наука та технологія
I know it's an old video, but still, it's really good. You explain things very well and not so fast people can't keep up. Great job!
Agreed! Drew's video eliminated a lot of the "fog and mystic" surrounding a home server build for me.
I won't have to sacrifice a goat to the gods of IT on the next full moon anymore! 8)
@@FarmerRiddick 😂😂
Thank you so much, I have been struggling with Collabra integration for few days now!! . The work around you explained fixed it. Great video!!
I appreciate how you glance away from the camera. Very cool to see a tuber being humble and normal about a camera pointed at them.
With this video, you just gave me a business idea
Nice video man
your background cool
Hey Drew, thanks a bunch for the easy-to-understand tutorial! Quick question though, if I wanted to configure my Nextcloud server with separate drives for the OS and my data, would that be possible? Or is it more trouble than it's worth? Just trying to keep my actual stored data off the OS drive if possible. Thanks man!
Go into your Nextcloud configuration file, and change your data directory to the drive that you want to store your data on.
@@DrewHowdenTech Perfect, thanks! You’re the man!
Love the vid, couple o questions...strange I know, what is the advantages of doing it this way? Would I be able to mount a USB drive and access the contents? Would you suggest formatting the drive in ext4 over NTFS?
You can get a Nextcloud app called “External storage support,” which will allow you to access external drives from Nextcloud.
Yes, definitely use Ext4 for a Linux server (or some other Linux-native file system like Btrfs)! Don’t use NTFS! It’s dated, proprietary, and frankly, crappy. Any Linux-native file system will be vastly superior in every way (as far as speed, reliability, and efficiency).
@@DrewHowdenTech Thanks for the reply, I'll check more into it, I was trying just a Samba instance on CentOS Stream 9, I need the drive accessible on Windows, Linux, and Android.
thank you so much
TY so much
Aaagh. Missed the live stream :(
Thanks for posting the recording though.
Good stuff
Glad you liked it.
At 16:26, I have an additional warning: "The PHP module "imagick" is not enabled although the theming app is. For favicon generation to work correctly, you need to install and enable this module." I've been searching for the last hour or two (time flies when using linux) trying different things. I came across sites that said to use Apache2, MySQL, etc. I don't know what any of this is. Sorry. I'm pretty new. Do you know what this warning is or if it's worth working through?
If you don't notice any ill effects, I would honestly say to just leave it alone.
The thing that complicates this is that we are using the Nextcloud snap, which basically has everything configured for us. Problem is, most of the help guides and forums for Nextcloud aren't written with this in mind.
Hey drew I just want to give you a little suggestion please try not to look away from camera .... That sometimes do hinder the connection .... Anyways awesome vid as always :D ..
Good suggestion. I try not to do that.
@@DrewHowdenTech be yourself! thx for guide :)
Neh, I look away when I’m thinking on the spot as well. I wouldn’t worry about it. Great vid.
Thanks so much for this tutorial! I legit watched and attempted to go through 3 other tutorials before finding yours and got hung up every single time! Yours worked PERFECTLY!!!!
I do have two questions though - I have Ubuntu Server on an old laptop - Ubuntu is running on a 128GB SSD, I have a 1tb HDD where I want all my files and folders to go(they are currently on an external drive) so my question is how do I point NextCloud to that storage on the server as it's main storage and then what's the best method to add my files and folders from the external? Connect to my desktop PC and just drag and drop over the network or best to do on the server machine?
Second question is anything else that needs to be done security wise? I am satisfied just accessing it from my house - dont need to access it from anywhere - but any other security stuff we should do with this? And also - whats a good backup solution to use?
Thank you again!
Reference this GitHub page for instructions on how to change Nextcloud's data directory: github.com/nextcloud-snap/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition
Just curious, and I don't mean to be rude, but why didn't you just install Ubuntu Server on the 1 TB HDD to begin with? I feel that installing the OS on a small drive, only to have to remap Nextcloud to a larger one, makes things needlessly complicated post-install.
For tips on how to improve your server's security, reference this video that I made on the subject: ua-cam.com/video/1mMAm0bHnGY/v-deo.html
As for a backup solution, since your server only have 1 TB of storage, I would simply copy your Nextcloud data directory to an external drive, and I'm sure 1 TB of cloud storage wouldn't be very expensive in this day and age, so also copy your data to that. Ideally, you want both an on-site, and an off-site backup.
@@DrewHowdenTechThank you very much for your reply!
I am pretty new to all this stuff - I had an old laptop not being used and decided well lets try a fun project so I can organize all of my files into one place since currently they are scattered all around many different hard drives and devices.
I already had that old laptop setup with a 128GB SSD and a 1TD 5400 RPM drive already installed inside it, so I just figured the best way to make use of what I had was to do it that way. Luckily all I did was follow your tutorial and set it all up so I have yet to put any files onto it yet, maybe I will go back and re-do the entire installation on the 1TD RPM drive, but then what would I do with that extra 128GB SSD laying around inside it?
Will checkout the video about improved security once I re-install this weekend on the 1TB drive so thank you again for that reference.
Also - best way to put the files from my external drive onto the server once installation is complete? I have about 400GB of files on an external drive I will be transferring - can I plug the drive into ubuntu server and just move the files locally rather than over the network?
Lastly - did you by chance make a video on copying the Nextcloud directory for backup?
You have been super helpful and your videos were so good so again thank you very much for all your help!
Uploading it to your server is probably the easiest way, but certainly not the most efficient. To make this go as fast as possible, connect both your PC and your server to your router via ethernet (at least temporarily).
If you want to copy data directly (which would be the most efficient way), you will have to mount your drive with "sudo mount /dev/sdXY /mnt" (example: sudo mount /dev/sdb1 /mnt), then copy the data to your Nextcloud data directory with "sudo cp /mnt/* /var/snap/nextcloud/common/nextcloud/data".
You can find out what "/dev/sdXY" is by running "lsblk" with your external drive plugged into your server.
By the way, you can use this method to back up your server. Just do the "cp" command in reverse.
Note that it has since been fixed for the collbora part where you edit the code is no longer needed
My broski, good tutorial! Could we use another port instead of 25 if the port has been blocked by our ISP? If so, how can we do this? Kind regards from the Netherlands!
Run "sudo nano /etc/postfix/master.cf", find the "smtp inet n - n - - smtpd" line, and replace "smtp" with your desired port number.
Don't forget to restart postfix with "sudo systemctl restart postfix" afterward to apply your changes!
HOW has that document server bug not been fixed?! Thanks for the help!
Hey Drew, really great video, i really appreciate your work! But as for today 04/23/2024, editing the richdocumentscode and applying that nextcloudoffice setting, it still can´t open the docx.
Apparently Nextcloud isn’t bundled with Collabora by default anymore. Though if you installed it through Nextcloud’s app centre, it should work.
@@DrewHowdenTech I thought sth had changed, but everything else, was still up to date, so for everyone else i really recommend this video :) Yeah app works
Hi Drew, thank you for this tutorial.
I have successfully set up my server and uploaded a few files. But, I shut down my Ubuntu server VM and then when I log into my VM, I'm unable to see my IPv4 address? I don't know what to do here and I'm unable to use my cloud server. Can you help me with this issue? When I run ssh username@address , it says "no route to host".
Did I make a mistake? Please let me know because I'm doing this for the first time.
Run "ip a".
Hey! What if I can't find that proxy.php file? I was given the error that richdocumentscode didn't exist? Also, I am unable to connect to the webserver using any other devices, how could I fix this? I am wanting to cloudshare documents. When I try to ssh from my laptop it says connection timed out, and the same thing happens when I try to use the app.
Apparently Collabora is not installed by default on Nextcloud anymore. You will need to install it from the Nextcloud store.
Also, if you are running this off a VM, you will need to set your VM’s network type to “bridged” under the “network” settings of your VM.
Are the files you plan to share supposed to be on the Ubuntu VM or can they be in the Windows Host PC?
The whole point of Nextcloud is that you have one system that you set up as a server, and you upload files to it from another device on your network (like your PC or your phone). Then you can access these files from any device on your network.
Thanks for the guide. I used an old laptop and found instructions to disable the lid suspend mode. After updates, I disabled cloud-init when it appeared to have a problem. Mail did not work but isn't needed (I hope). I have the DuckDNS client installed on a local Windows PC and was wondering if there is an easy way to install the client on the server. Thanks for your time. Edit: With a free no-ip hostname, editing config.php to modify the trusted_domains entry and opening ports 80, 443 on my router it appears that I can access Nextcloud without being on the network. I don't believe that this is a secure connection, though. Is there a way to make it more secure?
Are you able to connect over HTTPS?
Yes! I am using duckdns on a Windows pc to skip the no-ip $1.99 monthly fee. Https was available and tested by closing port 80 and logging on with the https duckdns address. Uing the Windows Nextcloud client my file transfer is about 1MB/sec through a second wifi router to the LAN (LAN router wifi doesn't work) I am looking into usb transfer of files to the server which would have been more convenient to start. Thanks again for the guide, you brought an old 2005 laptop back to life with an SSD.
Then your connection is secure. It’s just that your server’s certificate is not “trusted” by your browser.
By the way, if you connect your server and both your routers over Ethernet, you might get much better speed. Especially considering that you are using a 2005 laptop. That laptop probably only has an 802.11g Wi-Fi card, which is an old and much slower Wi-Fi standard.
do you know why it says port 22 connection timed out? I cant connect with my pc to the server because of this error
Do you have the right IP address for your server?
If you enabled UFW, did you open port 22?
Are your server and your PC on the same network?
Can you still set up a file/media server with ubuntu desktop and if yes are there any caviats?
Yes you can, but having a desktop environment running will unnecessarily take up resources on your server, which could be used for actually running your server.
bro I hosted the server on another pc and pc is on the same network did I able to access it or not?
As long as your PC is on the same network as your server, you should be able to connect to it from your PC no problem.
Port forwarding is only required when you need your server to be accessible from the internet (OUTSIDE your network).
Good tutorial! Sadly I can't get my Mail Services to work. I have an active dyndns, port forwarding and can access everything from external networks. I tried the non TLS way, it says "mail sent" but nothing ever was sent out i tried various mail providers...
It’s possible that your ISP is blocking port 25.
@@DrewHowdenTech you are right, was throwing my /var/log/mail.log content into chatgpt- gmail etc block such mails with unverified PTR Records. i threw in a disposable mail which i found online and the mail immediately showed up.
@@DrewHowdenTech You are right, I threw my /var/log/mail.log content into ChatGPT and found out that most mail providers (also gmail) block mails with bad Reverse-DNS entries- to configure such I d need to upgrade my internet plan. Instead I threw in a random temp mail provider, and received the Mail immediately :)
bro Did we log in as user and admin at the same time is it possible?
The user that you create when you install Nextcloud will automatically be an admin.
dude, you're my savior
great video. i want to know that how much storage will i get after doing all of this
However much storage you have on your server’s drive, minus the small amount of space taken up by Ubuntu Server and Nextcloud itself.
Drew, got error about WOPI. What my mistake here?
At what point in the process are you getting this error?
The tutorial is a bit outdated so the part with collabora is broken. When i install it from the app store in nextcloud theres no settings for it and + i cant open any documents it just wants to download them when u click on them
these things aside good tutorial
You also need to install the built-in CODE server (also from the Nextcloud app store).
love the mate but apparently I can't connect to server when login with IP address in web its says there no domain like that
Are you sure you have the right IP address?
Is your PC and your server on the same network?
If you enabled UFW, did you open ports 80 and 443?
@@DrewHowdenTech I am so sorry for not responding but I did figured it out I didn't command the right for the firewall rule and some sort of port 80 issue that I had to fix.
@@DrewHowdenTech when I watched the video again and re entered all the commands correctly I finally set it correctly.
HI bro I have a question
I can't connect to the server through ssh.
can you help?
What command are you typing in? Is OpenSSH installed and running on your server? If you have enabled a firewall on your server, is port 22 allowed through the firewall?
@@DrewHowdenTech thanks for the reply. but the problem is solved, my server IP was changed that's why I can't connect.
I keep getting this error every time i try to set up email server "A problem occurred while sending the email. Please revise your settings. (Error: Email could not be sent. Check your mail server log)" im new to this and im going insane trying to figure this out. help
Have you installed postfix with "sudo apt install postfix"?
How are your email settings configured in Nextcloud?
Have you set an email address on your Nextcloud account?
Hi drew,
I have a problem with the email server. i cant set it up and its saying "A problem occurred while sending the email. Please revise your settings. (Error: Email could not be sent. Check your mail server log)" this. is there a solution?
Did you install postfix?
@@DrewHowdenTech yes i did, also i cant access nextcloud through another network. should i add something in the linux or router? but i was thinking if i need to add the 80,443 ports to the router then that is not possible for me due to its already is in used by other device.
Yes, you will need to forward ports 80 and 443 to your Linux server.
@@DrewHowdenTech so i did that the way u showed in the video but its still not working outside of my network
also ty for helps mate
Check the WAN IP address of your router, and compare it with what shows up on whatismyipaddress.com. Are they the same?
Hi. Please I can't find the proxy.php file. Please help
Apparently Collabora is not installed by default on Nextcloud anymore. You will need to install it from the Nextcloud store.
Finally the ultimate video on mext cloud installation.
I just stucked on mail server setting.
I didn't changed the server name during installation of postfix, and kept as it is.
My server name has multiple hyphens (my-server-home-1)
Now, when i set up smtp as you shown and put this server name on the email server, its showing error.
(Erroe: email could not be sent. Check your mail server log).
Is it because of the server name has multiple hyphen on it? If so, then how to change it from terminal?
Can you plz guide me?
Encryption has to be set to “none.”
@@DrewHowdenTech yes, its already set to none. But still getting error
What about authentication method? Also, did you put your email address in the “personal info” settings?
@@DrewHowdenTech Yes, I did fill the email address and authentication tequired box kept unchecked. Basically i have followed exactly what you have shown the processes throughout the video.
Its weird for me that everything worked, except the mail..
It’s possible that your ISP is blocking the Mail server port (25). In that case, there’s nothing you can do about it.
I just get connectiln timed out when connecting to the ssh
Are you typing in the right username/IP address combo? If you have enabled UFW, have you allowed port 22 in your firewall rules?
Hey great video I got everything set up except for email server for some reason it keeps telling me "A problem occured while sending the email. Please revise your settings.(Error. Email could not be sent. Check your mail server log)
Did you install postfix?
@@DrewHowdenTech yes
@@DrewHowdenTech is it possible I need to uninstall it and reinstall?
You can try that.
@@DrewHowdenTech I'm having the same problem. Tried reinstalling, and still get the same error message of
"Jan 4 13:25:59 serveralexis postfix/postfix-script[248615]: starting the Postfix mail system
Jan 4 13:25:59 serveralexis postfix/master[248617]: daemon started -- version 3.6.4, configuration /etc/postfix
Jan 4 13:26:40 serveralexis postfix/smtpd[248787]: connect from localhost[127.0.0.1]
Jan 4 13:26:40 serveralexis postfix/smtpd[248787]: lost connection after STARTTLS from localhost[127.0.0.1]
Jan 4 13:26:40 serveralexis postfix/smtpd[248787]: disconnect from localhost[127.0.0.1] ehlo=1 starttls=1 commands=2"
I now have a fresh install after reinstalling, and before that I tried to change certain settings in /etc/postfix/main.cf, which didn't change anything either. What could be the problem?
Bro,
I can't find the group folders app and also it's not searching
Did you install it from the Nextcloud app centre?
@@DrewHowdenTech I searched it but I can't see the option
Try looking under the "featured" section of the Nextcloud app centre.
The email setup did not work for me at all. I tried two different email addresses for myself but neither came through. My server is literally just "media", so I went with "colin" "@media" and set up my correct email address in personal info, but nothing came through to either email I tested with.
Does Nextcloud give you a message highlighted in green that says "email sent" when you try to send a test email?
@@DrewHowdenTech I believe it did. But upon uninstalling I apparently broke everything so now I'm unable to even get back into Nextcloud using the IP I had previously. I do have the server set to a static IP, so I'm not sure why that is. I will likely reinstall Ubuntu Server from scratch to have a fresh start in the next day or two. Thank you for the responses!
How did you uninstall Nextcloud?
Also, did you check your email’s junk/spam folder?
I just remembered that during testing in preparation for this video, I found that some email services filter out emails from Nextcloud (they don't even go to the spam folder for some reason).
I know Gmail can receive these emails just fine (though they do end up in the spam folder), but your mileage with other email services may vary.
If you are unable to receive these emails, try using an email address with a different email service.
Hey ! The video is very good and usefull. But I have a problem, when I write : sudo nextcloud.enable-https self-signed, the Output is : sudo: nextcloud.enable-https: command not found.
Did I made mistake before ? There is, maybe a solution ?
I work on a Windows 10 computer with cmd
How did you install Nextcloud?
I install nextcloud in the installation of ubuntu
Try rebooting your server.
Just to confirm, you used the same method used in this video, correct?
@@DrewHowdenTechTo be sure I just try to re install Ubuntu and on the reboot when I have to wait for the nextcloud installation it's write :
cloud-init[1427]: ERROR: End run command: exit(1) this output is just after the line cloud-init[1427]: Begin run command: snap install --channel=stable nextcloud
12:33 In my configuration the directory does not exist
How to handle it?
Are you using the Nextcloud snap?
@@DrewHowdenTech yes, The /richdocumentscode directory is not available
Can you copy & paste the error message that your server is giving you when you run that command?
@@DrewHowdenTech I have the same error. It says "[ Directory '/var/snap/nextcloud/current/nextcloud/extra-apps/richdocumentscode' does not exist ]"
Apparently Collabora is not installed by default on Nextcloud anymore. You will need to install it from the Nextcloud store.
In 8:35 what's the's program?
It’s Terminal.
Ok Drew, here’s where I stand after 5 re-installs, +\- 11 hours of trying to get it to work & having memorized your video by now
1) Nextcloud office: “You have not configured the allow-list for WOPI requests. users may download restricted files via WOPI requests” Any thoughts?
2) Nextcloud office: once ‘use your own server’ & click save are selected “Could not establish connection to the Collabora Online server.” The default link in the box is ***my IP****/extra-apps/richdocumentscode/proxy.php?req=
Also did you say to CHECK or UNCHECK the “disable certificates” box?
3)postfix installed but email would not send. current version of nextcloud requires ‘server address’ & port # plus authentication defaults to login (instead of none).
1. If you can view and edit your documents just fine, I wouldn’t worry about it.
2. CHECK the “disable certificates” box.
3. Try “localhost” on port 22. Also, uncheck “authentication required.”
I also cannot do not have an "admin" option "Media" "groups" at 18:26. And at 20:03 I do not have a folder for "Media".
I'm removing Nextcloud from my server. I'm hoping I'll get helpful responses from you or others here, but until either that happens or I find a different tutorial that's actually helpful for myself, I'm giving up on Nextcloud.
I'm sure this has been helpful for others, and more than likely it's just some lack of knowledge on my end, or Nextcloud having changed something on their end. Nonetheless, thank you for the video.
You have to create a group folder called "Media" (or whatever name you want) under the Group folders extension. Same goes for the "media" group.
Though the "admin" group should exist by default.
@@DrewHowdenTech I had done those things, but yes, while it ought to have auto populated the "admin" group, for some reason it wasn't allowing me to select it. It did, however, recognize me as admin. It simply wasn't an option in the drop down menu. I'll try again in the next few days.
also have the missing admin option. you ever find a fix?
How to set up next nextcloud on ubuntu server and use NAS server for storage?
You don’t. You simply install Nextcloud directly on your NAS.
Its not working for me. It wont go to my ip online
In order to access your server from outside your network, you need to set up port forwarding on your router. I made a video on how to do that here:
ua-cam.com/video/PbV8gPi_RSo/v-deo.html
@Drew Howden Tech it's not that. It goes to the apache thing but doesn't come up with the installation screen
How did you install Nextcloud?
@Drew Howden Tech by following your tutorial. I just gave up and installed owncloud, I'm not sure what's different. You should do a tutorial on it, I really like it and others might too
9:55 enable-https command not working
What's the error message that you're getting?
@@DrewHowdenTech nextcloud.enable-https: command not found.
Are you using the Nextcloud snap? Are you running the command with sudo?
@@DrewHowdenTech I am running command with sudo
How did you install Nextcloud?
I like how when I added the phone region thing, my entire Nextcloud server broke lmao
What did you type into your Nextcloud configuration file?
I had an existing install of Ubuntu and this process did not work for me. Everything I went to localhost the site wouldn't load. This tutorial worked for me: ua-cam.com/video/Ro4V4cvIi4M/v-deo.html
So sorry to hear that. What point in the video did you get hung up on.
Please let me know what exact command(s) is are causing trouble for you, and paste their outputs (if applicable).
To be completely honest, your video is great post installation. Anyone who watches this video will have an easy time of their system is a fresh install. Mine wasn’t, because I was messing with my server as web hosting server prior. And honestly it was probably more me than anything. I installed Apache and changed some configs prior to messing with NextCloud to show this hello world index.html file and for some reason when I tried installing nextcloud it wouldn’t update Apache and wouldn’t direct localhost to Nextcloud. I did a fresh install of Ubuntu like you did and it worked smoothly. So technically this video is valid. Me problem. Great vid.
Hopefully no one else has the issue I did. I was just frustrated because I had to reinstall Ubuntu but not your fault.
the way you say "ubuntu" sounds like an insult towards someone
i have a prolem loading into the website after u do the sudo nextcloud.enable-https self but could it be because im on the version 24.04 LTS
What error message is it giving you?
@@DrewHowdenTech I put the ip address in and it doesn't load it says took too long to load
@@DrewHowdenTech do you think i shoul downgrade
@@DrewHowdenTech alos when i put the command: sudo ufw allow 80.443/tcp . it give error msg :bad port
@@DrewHowdenTech also i do want to make the laptop a storge server
12:39 mine just keeps saying this - [ Directory '/var/snap/nextcloud/current/nextcloud/extra-apps/richdocumentscode' does not exist ]
Nvm, fixed it. I had to go to the office app and download the built-in code server for it to show/work
@@lookitspandatv How? Pls guide me step by step.