<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ File sharing - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ File sharing - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Tue, 23 Jun 2026 22:45:28 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/file-sharing/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Send Large Video Files – Share a Big File with Email ]]>
                </title>
                <description>
                    <![CDATA[ Sending large files through email can be quite challenging. This is because each email client has a size limit for file sharing. Gmail and Yahoo limit file size to 25MB, while outlook and iCloud limit files to 20MB. So, if you decide to send, for exa... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-send-large-video-files-share-a-big-file-with-email/</link>
                <guid isPermaLink="false">66adf1476f5e63db3fc4361e</guid>
                
                    <category>
                        <![CDATA[ dropbox ]]>
                    </category>
                
                    <category>
                        <![CDATA[ email ]]>
                    </category>
                
                    <category>
                        <![CDATA[ File sharing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Google Docs ]]>
                    </category>
                
                    <category>
                        <![CDATA[ videos ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Wed, 27 Apr 2022 19:51:49 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/technology-2125547_1280.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Sending large files through email can be quite challenging. This is because each email client has a size limit for file sharing.</p>
<p>Gmail and Yahoo limit file size to 25MB, while outlook and iCloud limit files to 20MB.</p>
<p>So, if you decide to send, for example, a video file larger than 25MB, you might get an error that the message was rejected by the server because it’s too large.</p>
<p>Some email clients won’t show an error, but instead, suggest how you should send the large video file. </p>
<p>For example, Gmail will suggest that you upload the video to Google Drive: 
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss1-7.png" alt="ss1-7" width="600" height="400" loading="lazy"></p>
<p>And Outlook will suggest that you upload the video to Microsoft OneDrive:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss2-8.png" alt="ss2-8" width="600" height="400" loading="lazy"></p>
<p>How then do you send a large video file through email? That’s what I’m going to show you in this article.</p>
<h2 id="heading-how-to-send-large-video-files-through-email-using-google-drive">How to Send Large Video Files through Email Using Google Drive</h2>
<p>Google Drive is a cloud-based storage service provided by Google for sharing files.</p>
<p>As already shown in this article, Gmail prompts you to upload a video file larger than 25MB to Google Drive and then convert the video to an accessible link.</p>
<p>If you are using another email client like Outlook, or Yahoo, you can still send the large video using Google Drive.</p>
<p>Upload the video to your Google Drive and click the “Get link” button:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss3-7.png" alt="ss3-7" width="600" height="400" loading="lazy"></p>
<p>Change the access from restricted to “Anyone with the link”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss4-5.png" alt="ss4-5" width="600" height="400" loading="lazy"></p>
<p>Click “Copy link”, and then “Done”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss5-5.png" alt="ss5-5" width="600" height="400" loading="lazy"></p>
<p>Click “Compose” and paste the link to your email editor. Provide every other necessary detail and click the “Send” button:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss6-5.png" alt="ss6-5" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-send-large-video-files-through-email-using-dropbox">How to Send Large Video Files through Email Using Dropbox</h2>
<p>Dropbox is another cloud-based storage service that lets you back up and sync files on multiple devices. You can upload up to 50GB file size to your Dropbox account if you have one.</p>
<p>To send large video files through email by using Dropbox, upload the video to your Dropbox account and copy the link:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss7-4.png" alt="ss7-4" width="600" height="400" loading="lazy"></p>
<p>Compose your email and paste the link in to send the large video file:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss8-4.png" alt="ss8-4" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-send-large-video-files-through-email-using-video-sharing-services">How to Send Large Video Files through Email Using Video Sharing Services</h2>
<p>You can send large video files through email by using video-sharing services like YouTube and Vimeo.</p>
<p>And yes, you can upload videos to YouTube without having a YouTube channel. As long as you have a Gmail account, you have access to Google services, including YouTube. So if you have a Google account, technically you can have a YouTube channel.</p>
<p>To upload videos to YouTube, click the Create button on the top-right corner and select “Upload video”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss9-4.png" alt="ss9-4" width="600" height="400" loading="lazy"></p>
<p>Click on “SELECT FILES” to choose the file on your device:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss10-4.png" alt="ss10-4" width="600" height="400" loading="lazy"></p>
<p>Give the video a name and description, copy the link, and click “Next”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss11-3.png" alt="ss11-3" width="600" height="400" loading="lazy"></p>
<p>Follow other prompts and choose whether you want to make the video public or private, then click “Save”:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss12-2.png" alt="ss12-2" width="600" height="400" loading="lazy"></p>
<p>Head over to your email client composer and paste in the link so you can send the large video file:
<img src="https://www.freecodecamp.org/news/content/images/2022/04/ss13-1.png" alt="ss13-1" width="600" height="400" loading="lazy"></p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>You can’t send a large video file directly through email clients, but you can take advantage of the methods discussed in this article to send large video files.</p>
<p>Another way you can send a large video file through email is to compress the video through your native compressor or third-party file compressors. As long as the file is less than 20-25MB, you can send it through email.</p>
<p>But if you compress the video and it is still not less than 20-25MB, then you should use any of the methods pointed out in this article.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ SCP Linux Command – How to SSH File Transfer from Remote to Local ]]>
                </title>
                <description>
                    <![CDATA[ Whenever you're working with computers or any electronic device that has storage capacity, you might need to distribute or share information and files in various ways. Some of the most commonly shared files include audio files, images, videos, pdfs o... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/scp-linux-command-example-how-to-ssh-file-transfer-from-remote-to-local/</link>
                <guid isPermaLink="false">66b8dbfe47c23b7ae1ad0bb4</guid>
                
                    <category>
                        <![CDATA[ File sharing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ information security ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Linux ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Hillary Nyakundi ]]>
                </dc:creator>
                <pubDate>Tue, 21 Sep 2021 21:41:38 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/09/uide-to-writting-a-good-readme-file--3-.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Whenever you're working with computers or any electronic device that has storage capacity, you might need to distribute or share information and files in various ways.</p>
<p>Some of the most commonly shared files include audio files, images, videos, pdfs or any form of word documents.</p>
<p>Most of the time, the information being shared will be private or confidential – meaning it's meant for a specific person or a group of people, so protecting it is essential.</p>
<p>When it comes to devices like mobile phones we have app the facilitate the transfer of files like xender, appshare or even sometimes the use of bluetooth. Now, when it comes to computers the case is not different we have softwares and even sites that facilitate the same.</p>
<p>When it comes to sharing data in operating systems like Linux, there are multiple commands you can choose from to share information. But today we'll be focusing on the <strong>SCP</strong> command. It lets you share files and data securely and easily.</p>
<p>In today's market gap, having Linux skills is very essential and helpful more so if you are a system administrator. As a system admin sharing of data will be among your day to day activity and you will need the data being shared to be safe, and by using SCP command you will be able to achieve this.</p>
<p>Before we get started, let's begin by understanding what SCP is, and then we'll learn some commands you can use for file transfer.</p>
<h2 id="heading-what-are-scp-commands">What are SCP Commands?</h2>
<p>SCP is an acronym for Secure Copy Protocol. It is a command line utility that allows the user to securely copy files and directories between two locations usually between unix or linux systems.</p>
<p>The protocol ensures the transmission of files is encrypted to prevent anyone with suspicious intentions from getting sensitive information.</p>
<p>In simpler words we can say that SCP is a safer option for the <code>cp</code> (<em>copy</em>) command.</p>
<p>It is also important to note that SCP uses encryption over an SSH (Secure Shell) connection, this ensures that the data being transferred is protected from suspicious attacks.</p>
<h2 id="heading-scp-syntax">SCP Syntax</h2>
<p>Just like any other commands used in the terminal, the SCP also have a format that is used for a successful execution to happen. By understanding the syntax it makes it easier for you to write down the commands:</p>
<pre><code class="lang-bash">scp [OPTIONS] [[user@]src_host:]file1 [[user@]dest_host:]file2
</code></pre>
<ul>
<li><code>scp</code> - It initializes the command and ensures a secure shell is in place.</li>
<li><code>OPTIONS</code> - They grant different permissions depending on how they have been used. Some of the most common options include:</li>
<li><strong>P</strong>(Caps) - specifies the port to establish connection with the remote host.</li>
<li><strong>p</strong>(lowercase) - preserves the times-tamp for ease of modification and access.</li>
<li><strong>r</strong> - copies the entire directory recursively</li>
<li><strong>q</strong> - copies files quietly, doesn't display the progress messages. Also known as quiet mode.</li>
<li><strong>C</strong> - for compression of data during transmission.<br>To understand more about OPTIONS read <a target="_blank" href="https://linux.die.net/man/1/scp">scp options</a></li>
<li><code>src_host</code> - where the file is hosted. The source can either be a client or server depending on the origin of the file.</li>
<li><code>dest_host</code> - where the file will be copied to.</li>
</ul>
<p>Since we are dealing with file transmission, it definitely means that there have to be an involvement of more than one machine to make the process possible. We are able to use SCP in the following cases:</p>
<ul>
<li>Copy files within same machine.</li>
<li>Copy files from a local host to remote host and vice versa.</li>
<li>Copy files between two different remote servers.</li>
</ul>
<p>At this point, it will be fair to state that before you use any SCP commands you will need to have a few things in place:</p>
<ul>
<li>SSh installed on both the client and the server machines.</li>
<li>Root access to both client and server machines.</li>
</ul>
<p>With two thing's ready you are good to go. Let's get started by seeing the commands in action.</p>
<h2 id="heading-common-scp-commands">Common SCP Commands</h2>
<h3 id="heading-copy-file-from-local-host-to-remote-server">Copy File From Local Host to Remote Server</h3>
<p>When copying files, being able to transfer files/data from local storage to remote server is very essential. When using the SCP commands you will need to specify a few things for this to happen.</p>
<p>You will have to specify the path to the file as the source and also specify the remote host path, where the files are being copied to.</p>
<p>Let's take a scenario where we have a file <code>test.txt</code> and we need to copy it to a remote server, our command will look like below:</p>
<pre><code>scp test.txt userbravo@destination:/location2
</code></pre><p>We are not limited to the number of files we can copy. Let's say we are on our desktop in the folder called web where we have <code>.php</code> file extensions and we need to copy the to remote server home directory. Our command will look like:</p>
<pre><code>scp *.php userbravo@destination_host:<span class="hljs-regexp">/~/</span>
</code></pre><p><strong>*.php</strong> - copies all the files with the .php extension in the currently specified folder.<br><strong>/~/</strong> - means copy them to the home directory.</p>
<p>Let's say you wanted to copy a file named test.txt and save it with a different name in the remote server this time round using an option of port. The command will be:</p>
<pre><code>scp -P <span class="hljs-number">8080</span> test.txt userbravo@destination_host:<span class="hljs-regexp">/user/</span>home/test2.txt
</code></pre><p>In this example we have copied a file test.txt from local machine into remote where it will be saved as test2.txt using port 8080.</p>
<h3 id="heading-copy-files-from-remote-to-local">Copy Files From Remote to Local</h3>
<p>A better way to understand this is by use of an example. Take a scenario where you want to copy files from remote system. To copy the files you will need to first invoke the SCP, followed by the remote username@IP address, path to file.</p>
<p>If you do not specify the path, it is assumed as default in this case which will be the user's home directory, this will be followed the path where the file will be stored locally.</p>
<p><strong>The Syntax</strong></p>
<pre><code>scp &lt;remote_username&gt;@&lt;IPorHost&gt;:&lt;PathToFile&gt;   &lt;LocalFileLocation&gt;
</code></pre><p>Let's say I wanted to copy a file named <em>linuxcheatsheet</em> from the remote device with this address <em>192.168.1.100</em>.</p>
<p>The <em>linuxcheatsheet</em> file is stored on the kali user’s home directory, the user I will authenticate. Therefore after the colon, I don’t need specify the path because it's the default one, which is the home directory, and I just type the filename (“linuxcheatsheet”). Then, I specify the current directory as the local location to store the file by typing a dot.</p>
<pre><code>scp lary@<span class="hljs-number">192.168</span><span class="hljs-number">.1</span><span class="hljs-number">.100</span>:linuxcheatsheet .
</code></pre><h3 id="heading-copy-files-from-remote-host-to-another">Copy Files From Remote Host to Another</h3>
<p>The beauty of using SCP in file transferring, is that it does not only allow connection between local machines but also it allows for you to connect to remote servers.</p>
<p>Let's say we wanted to copy a file named test.txt, to another remote server the command would look like below:</p>
<pre><code>scp user1@host1.com:<span class="hljs-regexp">/files/</span>test.txt user2@host2.com:/files
</code></pre><p>What this command will do is copy test.txt from files folder in the the user1 and create a replicate of it in user2 which runs on <em>host2.com</em> still on the files folder.</p>
<h3 id="heading-copying-multiple-files">Copying Multiple Files</h3>
<p>When copying multiple files, all you need to do is specify the file name as the source path. for example.</p>
<p><strong>The Syntax</strong></p>
<pre><code>scp file1 file2 ... user@&lt;ip_address_of_user&gt;: Destination
</code></pre><p>Let's say we wanted to copy files 1,2,3 and 4. The command would look like below:</p>
<pre><code>scp file1.txt file2.txt file3.txt file4.txt user1@host1.com:<span class="hljs-regexp">/home/u</span>ser1/Desktop
</code></pre><h2 id="heading-takeaway-points">Takeaway Points:</h2>
<ul>
<li>To be able to copy files, you must have read permissions on the source file and write permission on the target system.</li>
<li>The SCP command relies on SSH for secure data transfer, meaning it requires a password to authenticate on remote systems.</li>
<li>Watch out when copying files with the same name and location, as SCP will overwrite them without warning you.</li>
<li>To be able to distinguish between local and remote locations, use full colon <strong>:</strong>.</li>
</ul>
<h2 id="heading-wrap-up">Wrap Up</h2>
<p>Whether you are a support engineer, system admin, or even a growing developer like myself who uses Linux or wants to learn it – it's likely that you will have to transfer files at some point. And knowing these simple SCP commands will come in handy.</p>
<p>In this article, we have covered some of the most common scenarios where you'd want to use SCP and hopefully you have learned something new.</p>
<p>Enjoy Coding ❤</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to set up AWS S3-based enterprise network file sharing using Nextcloud ]]>
                </title>
                <description>
                    <![CDATA[ Nextcloud is an open source software suite that, when installed on a Linux server, can leverage storage capacity for saving, editing, and consuming a wide range of document types — including services like audio/video call hosting. Nextcloud also prov... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/aws-s3-based-enterprise-network-file-sharing-using-nextcloud/</link>
                <guid isPermaLink="false">66b995b3d9d170feecefbb9b</guid>
                
                    <category>
                        <![CDATA[ File sharing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Linux ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Nextcloud ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ David Clinton ]]>
                </dc:creator>
                <pubDate>Tue, 13 Aug 2019 13:30:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2019/08/nextcloud-ui.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Nextcloud is an open source software suite that, when installed on a Linux server, can leverage storage capacity for saving, editing, and consuming a wide range of document types — including services like audio/video call hosting. Nextcloud also provides <em>client</em> applications that allow users on Linux, Windows, MacOS, and smart phone platforms to engage with media resources.</p>
<p>Using Nextcloud, you can create your own private versions of Dropbox or Google Drive, but on your terms and without having to worry about unexpected changes to availability or service/privacy agreements.</p>
<p>So great. Nextcloud has some real benefits. But going it alone means you’re on the hook for the costs and complexity of data hosting, replication, and backups. Is it really worth all the trouble and expense when you can get lots of storage at little or no cost using any one of those other services?</p>
<p>Good news: you can have it both ways. For particularly sensitive data, you can keep the whole thing in-house. But you can also build a Nextcloud server as your front end (to finely control how users interface with your media), but have the data itself automatically and securely saved to cheaper, reliable third party services including Dropbox, Google Drive, and Amazon’s S3. If, down the line, you find you need to migrate your data away from a third-party provider like S3, you can do it without your users ever noticing the change.</p>
<h2 id="heading-hardware-prerequisites">Hardware prerequisites</h2>
<p>Based on content from my Manning book, <a target="_blank" href="https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&amp;a_bid=4ca15fc9">Linux in Action</a>, let’s put something together using Ubuntu.</p>
<p>It’s always a good idea to check out an application’s documentation to make sure that you’ve got enough hardware and software muscle to handle the load. The figure below shows Nextcloud’s System Requirements web page. If you’re planning to host a simple, lightly-used server providing for just a few dozen users, then you’ll find Nextcloud is a fairly easy to get along with, demanding nothing that can’t be handled by an off-the-shelf container.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-120.png" alt="Image" width="600" height="400" loading="lazy">
<em>Hardware and software requirements for both recommended and minimal Nextcloud installations</em></p>
<p>Any old minimal hardware configuration will work just fine for technology testing, but I wouldn’t want to rely on a single LXC container running off an old PC to serve tens of thousands of users and terabytes of data. Planning an enterprise-scale deployment? Nextcloud <a target="_blank" href="https://docs.nextcloud.com/server/12/admin_manual/installation/deployment_recommendations.html">provides a useful, multi-level Deployment Recommendations guide</a> to provisioning full-strength platforms.</p>
<p>Here, for instance, is what Nextcloud recommends for a smaller work group with up to 150 users accessing up to 10TB of data:</p>
<ul>
<li>One sever with 2 CPU cores</li>
<li>16GB of RAM</li>
<li>Authentication through Lightweight Directory Access Protocol (LDAP) (a widely-used distributed information protocol)</li>
<li>Red Hat Enterprise Linux or Ubuntu 16.04 <em>with</em> vendor support<br>Apache with TLS/SSL encryption certificate</li>
<li>The MySQL or MariaDB database</li>
<li>The Btrfs file system mounted with <em>nodatacow</em> for Nextcloud data partitions to permit <em>zero downtime</em> backups</li>
<li>Caching with memcache to speed up access performance</li>
</ul>
<h2 id="heading-building-a-lamp-server">Building a LAMP server</h2>
<p>Building a base environment suitable for testing the package should be simple enough. Here are all the packages you’ll need for your server in a single command. I threw in wget and nano just in case they’re not already installed. In the interest of keeping the base image as small as possible, packages like nano are often not installed by default on some virtualized platforms like LXC containers.</p>
<pre><code># apt install apache2 mariadb-server libapache2-mod-php7<span class="hljs-number">.0</span> \
 php7<span class="hljs-number">.0</span>-gd php7<span class="hljs-number">.0</span>-json php7<span class="hljs-number">.0</span>-mysql php7<span class="hljs-number">.0</span>-curl php7<span class="hljs-number">.0</span>-mbstring \
 php7<span class="hljs-number">.0</span>-intl php7<span class="hljs-number">.0</span>-mcrypt php-imagick php7<span class="hljs-number">.0</span>-xml php7<span class="hljs-number">.0</span>-zip \
 wget nano
</code></pre><p>If you’re not picky about using MySQL rather than MariaDB — and you’re on an Ubuntu server — then you could just as easily spare yourself a lot of typing and go with the LAMP server metapackage I mentioned in the previous chapter. Again: don’t forget the caret (<code>^</code>) at the end of the package name. </p>
<pre><code>apt install lamp-server^
</code></pre><p>Once installed, don’t forget to run the MySQL secure installation tool:</p>
<pre><code>mysql_secure_installation
</code></pre><p>If you chose the MariaDB route and found yourself having to use sudo with that command, here’s a quick fix:</p>
<pre><code>MariaDB [(none)]&gt; SET PASSWORD = PASSWORD(‘your-password’);
MariaDB [(none)]&gt; update mysql.user set plugin = ‘mysql_native_password’ where User=’root’;
MariaDB [(none)]&gt; FLUSH PRIVILEGES;
</code></pre><h2 id="heading-apache-configuration">Apache configuration</h2>
<p>To ensure that Apache will be able to communicate with Nextcloud, there are a few relatively simple adjustments you’re going to have to make. First off, you should enable a couple of Apache modules through the a2enmod tool. The rewrite module is used to rewrite URLs in real time as they’re moved between a client and the server. The headers module performs a similar function for HTTP headers.</p>
<pre><code>a2enmod rewrite
a2enmod headers
</code></pre><p>If you’re not planning to use this server for any other purpose, locating the Nextcloud application files in the Apache document root would work. Since the value of the <code>DocumentRoot</code> entry in the 000-default.conf file in your /etc/apache2/sites-available/ directory already points to /var/www/html/, there’s really nothing left for you to do.</p>
<p>However, placing Nextcloud’s data files in the default document root presents a potential security risk, so you will probably want your Nextcloud application in some other part of your file system.</p>
<p>There are two ways to tell Apache how to find site files that aren’t in the document root. The “Ubuntu method” involves adding a new section to your existing 000-default.conf file that contains all the necessary information. However, most people seem to prefer creating a new .conf file in the /etc/apache2/sites-available/ directory for each new service. Both work just fine, but here’s what the separate file should look like assuming you placed the application in /var/www/ rather than the document root:</p>
<pre><code>Alias /nextcloud “/<span class="hljs-keyword">var</span>/www/nextcloud/”
&lt;Directory /<span class="hljs-keyword">var</span>/www/nextcloud/&gt;
 Options +FollowSymlinks
 AllowOverride All
&lt;IfModule mod_dav.c&gt;
 Dav off
 &lt;/IfModule&gt;
SetEnv HOME /<span class="hljs-keyword">var</span>/www/nextcloud
 SetEnv HTTP_HOME /<span class="hljs-keyword">var</span>/www/nextcloud
&lt;/Directory&gt;
</code></pre><p>Note that the “Alias” line associates the contents of the /var/www/nextcloud/ directory with the “nextcloud” host (or “site”), and the two “SenEnv” lines assign environment variables that will define the way the Nextcloud application works</p>
<p>A similar directive using the Ubuntu method would involve adding a section in your 000-default.conf file that might look something like this:</p>
<pre><code>&lt;VirtualHost *:<span class="hljs-number">443</span>&gt; <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">1</span>&gt;</span>
 ServerName bootstrap-it.com
 DocumentRoot /var/www/nextcloud
 ServerAlias bootstrap-it.com/nextcloud <span class="hljs-tag">&lt;<span class="hljs-name">2</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">VirtualHost</span>&gt;</span></span>
</code></pre><p>As you can see in the figure, when Apache reads this file, it will redirect all incoming traffic addressed to example.com/nextcloud to the application files in /var/www/ (assuming, again, that your domain is example.com…as before, an IP address will work just as well).</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-121.png" alt="Image" width="600" height="400" loading="lazy">
<em>Apache reads configuration files in /etc/apache2/sites-enabled/ and uses their settings to redirect requests</em></p>
<p>Finally, you’ll need to create a symbolic link in the /etc/apache2/sites-enabled/ directory pointing to the nextcloud.conf file you created in /etc/apache2/sites-available/.</p>
<pre><code>ln -s /etc/apache2/sites-available/nextcloud.conf \
    /etc/apache2/sites-enabled/nextcloud.conf
</code></pre><p>But why? And what’s a symbolic link?</p>
<p>When Apache starts up, it reads the contents of /etc/apache2/sites-enabled/ looking for site configurations to load. Those configurations won’t actually exist in /etc/apache2/sites/enabled/, but there will be symbolic links to the real files in /etc/apache2/sites-available/.</p>
<p>So why not just tell Apache to read /etc/apache2/sites-available/ in the first place and cut out the middleman? Because hanging it all on symbolic links makes it really easy and convenient to quickly disable a site and then — when you’ve finished a round of edits — re-enable it once again. Rather than having to actually delete and rewrite the real file, you’ll only need to play with an easy-to-manage link to it.</p>
<p>Symbolic links? They’re just objects that <em>represent</em> files or directories living elsewhere on a file system. They allow a user to execute or view a resource in one place, even though the resource itself is elsewhere.</p>
<h2 id="heading-downloading-and-unpacking-nextcloud">Downloading and unpacking Nextcloud</h2>
<p>You can download the most recent Nextcloud package from the <a target="_blank" href="https://nextcloud.com/install/">Nextcloud Install page</a>. If you’re installing to a container or VM — or from a server without a desktop GUI installed — then the most convenient approach is to get the package’s download URL and grab the package from the command line.</p>
<p>One quick way to get that URL from the Nextcloud site (from a regular session on your own PC) is to click the Download tab beneath Get Nextcloud Server and then, as you can see below, the Details and Download options button. Right click on the .tar.bz2 link and select Copy Link Address from the menu.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-122.png" alt="Image" width="600" height="400" loading="lazy">
<em>Links to Nextcloud download archives: either the .tar.bz2 or the .zip formats will work</em></p>
<p>You can copy that URL into a <code>wget</code> command either through right-clicking in the terminal and selecting paste, or through SHIFT+CTRL+v.</p>
<pre><code>wget https:<span class="hljs-comment">//download.nextcloud.com/server/releases/nextcloud-12.0.0.tar.bz2</span>
</code></pre><p>Don’t forget to click the MD5 or SHA256 hash links and confirm that those values are identical to the hashes you generate from the downloaded archive. Unpacking a .tar.bz2 archive requires the xjf arguments rather than the <code>xzf</code> you would use for a .gz.</p>
<pre><code>tar xjf nextcloud<span class="hljs-number">-12.0</span><span class="hljs-number">.0</span>.tar.bz2
</code></pre><p>The next step involves copying the unpacked files and directories to their new home — which, following the best practices I mentioned earlier — will be in /var/www/, a location outside the document root. Adding -r to the copy command will copy the files “recursively”, to include subdirectories and their contents.</p>
<pre><code>cp -r nextcloud /<span class="hljs-keyword">var</span>/www/
</code></pre><p>Just two more small steps and you’re good to go. Apache will need full access to all the files in the Nextcloud directories in order to do its job. You could have root own them, but that means you’d have to give visiting users root powers to access those files. As you might imagine, giving everyone on the internet that kind of access to your files poses just a wee problem. So, many web servers use a special system user called www-data.</p>
<p>This next command will use chown to turn the user and group ownership of all those files over to the web server user www-data. Using the uppercase -R will (like the lowercase -r you used with cp) apply the command recursively to all files and directories in the directory hierarchy.</p>
<pre><code>chown -R www-data:www-data /<span class="hljs-keyword">var</span>/www/nextcloud/
</code></pre><p>Apache has no idea of the kinds of stuff we’ve been up to while it wasn’t looking, so you’d better let it in on the fun by restarting the service.# systemctl restart apache2</p>
<p>If that restart <em>wasn’t</em> successful, then make a note of any error messages and see if there’s anything you can fix. You can also dig a bit deeper into the logs by displaying the last ten entries in the Journal. There might, for instance, be a reference to a specific line in the nextcloud.conf file.</p>
<pre><code>journalctl | tail
</code></pre><p>But if everything went well, then direct your browser to your container’s IP address followed by <code>nextcloud</code>. You’ll be taken to a page where you’re asked to create a new admin account and provide valid login credentials for your MariaDB database. Unless you’ve created a different database user account for the purpose, you’ll use <code>root</code> and the password you gave it earlier.</p>
<pre><code><span class="hljs-number">10.0</span><span class="hljs-number">.3</span><span class="hljs-number">.36</span>/nextcloud
</code></pre><p>Once your information is digested, you’ll be shown links to Nextcloud’s client apps and then dropped into the administration console you can see in the next figure. That’s where you can upload, view, and share documents and media files.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-123.png" alt="Image" width="600" height="400" loading="lazy">
<em>The main Nextcloud console, complete with sample folders and files — you can work with objects here just as you would using an OS file manager</em></p>
<p>As the site administrator, you can also create groups and users, assign permissions and quotas, and manage how the site functions.</p>
<h2 id="heading-using-aws-s3-as-your-primary-nextcloud-storage">Using AWS S3 as your primary Nextcloud storage</h2>
<p>The thing about storing stuff is that you have to find space to put it all. And, since all storage devices will eventually fail without warning, you’ll need multiple copies of each device. Figuring out how to provision, connect, and maintain such storage arrays is time consuming, and keeping it going is relatively expensive.</p>
<p>Cloud storage, on the other hand, is comparatively cheap and — as you can read in my Manning “<a target="_blank" href="https://www.manning.com/books/learn-amazon-web-services-in-a-month-of-lunches?a_aid=bootstrap-it&amp;a_bid=1c1b5e27">Learn Amazon Web Services in a Month of Lunches</a>” book — simple to set up. Since the big cloud providers invest vast funds in data security and resilience, their services are pretty much guaranteed to be more reliable than anything you could put together.</p>
<p>Therefore, using cloud-based data as a back end to your locally hosted Nextcloud site is a serious option to explore. Here’s how it works.</p>
<p>You’ll first need to enable the External storage support App bundle. From the gear icon at the top right, click the Apps item, and then the Disabled apps link in the left panel. As the figure shows, the External storage support option appears in the list. Click Enable.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-124.png" alt="Image" width="600" height="400" loading="lazy">
<em>The list of currently available apps, including External storage support</em></p>
<h2 id="heading-connect-nextcloud-to-an-s3-bucket">Connect Nextcloud to an S3 bucket</h2>
<p>From the command line on any computer with the AWS CLI installed and configured for your AWS account (see <a target="_blank" href="https://livebook.manning.com/#!/book/learn-amazon-web-services-in-a-month-of-lunches/chapter-12/">chapter 12 of my AWS in a Month of Lunches book</a> for details), create a new bucket with a globally unique name.$ aws s3 mb nextcloud32327</p>
<p>Retrieve a set of account Access Keys from the Your Security Credentials page in the AWS console (<a target="_blank" href="https://livebook.manning.com/#!/book/learn-amazon-web-services-in-a-month-of-lunches/chapter-7/">chapter 7 in the AWS book</a>). You can also use an existing set of keys if you’ve got one available.</p>
<p>Now head back to your Nextcloud console, click on Admin from the gear drop-down, and then on the External storages link that should be visible in the left panel. This will open the External storages page, where you can click the Add storage drop-down and select Amazon S3 from the list — which also includes Dropbox and Google Drive.</p>
<p>You’ll be prompted to enter the S3 bucket you want to use along with your Access and Secret keys. All other fields — which allow you to customize your configuration using things like non-standard ports or SSL encryption — are optional. When you’re done, clicking the check mark to the right will save your settings and set Nextcloud off trying to authenticate with AWS.</p>
<p>If you’re successful, you’ll see a happy green circle to the left, as is visible in the figure. If it doesn’t work, the most likely cause is that you somehow used invalid authentication keys. It can’t hurt to confirm network connectivity to the internet and, in particular, AWS.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-125.png" alt="Image" width="600" height="400" loading="lazy">
<em>The External storages setup page for Amazon S3, showing a successful connection to my S3 bucket</em></p>
<p>You can test your new storage configuration by copying and pasting a file from your computer into the folder in your Nextcloud console. Then, from your AWS CLI, list the contents of your bucket.</p>
<pre><code>aws s3 ls s3:<span class="hljs-comment">//nextcloud32327</span>
testfile.pdf
</code></pre><p>Of course, you’ll need to test it the other way too. Copy a local file to the bucket from your command line.</p>
<pre><code>aws s3 cp test.txt s3:<span class="hljs-comment">//nextcloud32327</span>
</code></pre><p>That test.txt file should appear in your console. Glorious multi-platform storage integration.</p>
<p><em>This article is excerpted from my</em> <a target="_blank" href="https://www.manning.com/books/linux-in-action?a_aid=bootstrap-it&amp;a_bid=4ca15fc9"><em>Manning “Linux in Action” book</em></a><em>. There’s lots more fun</em> <a target="_blank" href="https://bootstrap-it.com/index.php/books/"><em>where this came from</em></a><em>, including a hybrid course called</em> <a target="_blank" href="https://www.manning.com/livevideo/linux-in-motion?a_aid=bootstrap-it&amp;a_bid=0c56986f&amp;chan=motion1"><em>Linux in Motion</em></a><em>that’s made up of more than two hours of video and around 40% of the text of Linux in Action. Who knows…you might also enjoy my</em> <a target="_blank" href="https://www.manning.com/books/learn-amazon-web-services-in-a-month-of-lunches?a_aid=bootstrap-it&amp;a_bid=1c1b5e27"><em>Learn Amazon Web Services in a Month of Lunches</em></a><em>.</em></p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
