The External Storage Support application enables you to mount external storage
services and devices as secondary ownCloud storage devices. You may also allow
users to mount their own external storage services.

All of these connect to a LAN ownCloud server that is not publicly accessible,
with one exception: Google Drive requires an ownCloud server with a registered
domain name that is accessible over the Internet.

In general it is recommended to configure the background job Webcron or
Cron as described in Defining Background Jobs
so ownCloud is able to detect files added to your external storages without the need
for a user to be browsing your ownCloud installation.

Please also be aware that ownCloud might not always be able to find out what has been
changed remotely (files changed without going through ownCloud), especially
when it’s very deep in the folder hierarchy of the external storage.

You might need to setup a cron job that runs sudo-uwww-dataphpoccfiles:scan--all
(or replace “–all” with the user name, see also Using the occ Command)
to trigger a rescan of the user’s files periodically (for example every 15 minutes), which includes
the mounted external storage.

Now go to your ownCloud Admin page. Your ownCloud configuration requires only
the local mount name, the App Key and the App Secret, and which users
or groups have access to the share. Remember the little gear icon at the
far right for additional options.

After entering your local mount name, enter App Key and App Secret.

If you are not already logged into Dropbox, you will be prompted to login
and authorize access. This happens only once, when you are first creating
the new share. Click Allow, and you’re done.

Remote Subfolder, the FTP directory to mount in ownCloud. ownCloud defaults to the root
directory. When you specify a different directory you must leave off the
leading slash. For example, if you want to connect your
public_html/images directory, then type it exactly like that.

Choose whether to connect in the clear with ftp://, or to encrypt your
FTP session with SSL/TLS over ftps:// (Your FTP server must be
configured to support ftps://)

Enter the ownCloud users or groups who are allowed to access the share.

Note

The external storage FTP/FTPS/SFTP needs the allow_url_fopen PHP
setting to be set to 1. When having connection problems make sure that it is
not set to 0 in your php.ini.

SFTP uses SSH rather than SSL, as FTPS does, so your SFTP sessions are always
safely tucked inside an SSH tunnel. To connect an SFTP server you need:

ownCloud uses OAuth 2.0 to connect to Google Drive. This requires configuration
through Google to get an app ID and app secret, as ownCloud registers itself
as an app.

All applications that access a Google API must be registered through the
Google Cloud Console. Follow along
carefully
because the Google interface is a bit of a maze and it’s easy to get lost.

If you already have a Google account, such as Groups, Drive, or Mail, you can
use your existing login to log into the Google Cloud Console. After logging in
click the Create Project button.

Give your project a name, and either accept the default Project ID or
create
your own, then click the Create button.

You’ll be returned to your dashboard.

Google helpfully highlights your next step in blue, the Use Google APIs
box. Make sure that your new project is selected, click on Use Google APIs
,
and it takes you to Google’s APIs screen. There are many Google APIs; look for
the Google Apps APIs and click Drive API.

For some reason Google warns us again that we need to create credentials. We
will use 0Auth 2.0.

Now we have to create a consent screen. This is the information in the screen
Google shows you when you connect your new Google app to ownCloud the first
time. Click Configure consent screen. Then fill in the required form
fields.
Your logo must be hosted, as you cannot upload it, so enter its URL. When
you’re finished click Save.

The next screen that opens is Create Client ID. Check Web Application,
then enter your app name. Authorized JavaScript Origins is your root
domain,
for example https://www.example.com, without a trailing slash. You need two
Authorized Redirect URIs, and they must be in this form:

You can mount SMB/CIFS file shares on ownCloud servers that run on Linux. This
only works on Linux ownCloud servers because you must have smbclient
installed. SMB/CIFS file servers include any Windows file share, Samba servers
on Linux and other Unix-type operating systems, and NAS appliances.

You need the following information:

Folder name – Whatever name you want for your local mountpoint.

Host – The URL of the Samba server.

Username – The username or domain/username used to login to the Samba server.

Password – The password to login to the Samba server.

Share – The share on the Samba server to mount.

Remote Subfolder – The remote subfolder inside the Samba share to mount (optional, defaults to
/). To assign the ownCloud logon username automatically to the subfolder, use $user instead of a particular subfolder name.

And finally, the ownCloud users and groups who get access to the share.

This works the same way as setting up a SMB/CIFS mount, except you can use your
ownCloud logins intead of the SMB/CIFS server logins. To make this work, your
ownCloud users need the same login and password as on the SMB/CIFS server.

Note

Shares set up with SMB/CIFSusingOClogin cannot be shared in
ownCloud. If you need to share your SMB/CIFS mount, then use the SMB/CIFS
mount without oC login.

The configuration of mounts created within the External Storage App are stored
in the data/mount.json file. This file contains all settings in JSON
(JavaScript Object Notation) format. Two different types of entries exist:

Group mounts: Each entry configures a mount for each user in group.

User mount: Each entry configures a mount for a single user or all users.

For each type, there is a JSON array with the user/group name as key and an
array of configuration values as the value. Each entry consist of the class name
of the storage backend and an array of backend specific options (described
above) and will be replaced by the user login.

Although configuration may be done by making modifications to the
mount.json file, it is recommended to use the Web-GUI in the administrator
panel (as described in the above section) to add, remove, or modify mount
options to prevent any problems. See Configuring External Storage (Configuration File) for
configuration examples.