How to connect DigitalOcean Droplet using sFTP FileZilla
DigitalOcean Droplets are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each Droplet you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure.
You can transfer files from a local computer to a Droplet using a variety of different protocols and file transfer clients. DigitalOcean recommends using SFTP (SSH File Transfer Protocol) with FileZilla because it is a free, open-source, cross-platform tool with a user interface that supports newer users.
Who's this for?
This tutorial is for anyone out there, who is trying or wants to upload files to a VPS. For this tutorial, we are referring to VPS to DigitalOcean droplets.
We will use the SFTP client — FileZilla to upload files to the DigitalOcean droplet.
Step 1: Install FileZilla
On the machine from which you want to transfer files, download and install FileZilla. Choose the version for your operating system.


Step 2: Add Site in FileZilla
Start the FileZilla application. We need to add our domain or connect our web server.
Assuming you are using MAC OS — Click File > Add Site (Windows system will have Add Site option).


The image above highlights the add site dialogue box. Few things to note here, these are
- Host
- Protocol
- Login Type
Follow the image below to connect your DigitalOcean droplet.


Enter your DigitalOcean droplet IP in the host
field, leaver the port field as-is.
Change the protocol
from FTP
to SFTP
.
Also, change Login Type
to Ask for password
– this is recommended for security reasons. Add-in username
, if you haven’t created a separate user yet, it will be root
.
Click connect
button.


A password pop-up box will appear. This is where you basically add the root user password. Enter the password and click “ok”.


If everything goes correctly so far, you should see the right side that says Remote site
with server-side files.


Now the screen is split into two halves, where the left side shows local files and the right side shows the files on the server.
Step 3: Upload Project Files to DigitalOcean Droplet
On the right side field area — next to Remote site
enter the directory where you want to upload your project files.
In case you don’t have any project directory already created, follow the below
- On the remote section — next to
Remote site
, type/var/www
- Create a directory by right-clicking on the blank space right side. You should now see a popup — click
create directory
. Give it a name. - Once the above is done, you should see a directory with the name you gave. Double click the directory to enter inside the project directory.


Now, let’s find the actual project files which you want to upload to the directory.


Select the files you want to upload, right-click on the selected area and click Upload
.


That should upload the files, you will be able to see them on the remote site section.


With the above, your project files are now uploaded to the server.
If you want to know more about how to configure a domain and set up your project follow our other articles to learn more — How to create subdomains on DigitalOcean, How to add domains and host websites on DigitalOcean droplet
How to install a WordPress Blog to your Laravel Web Application
Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller architectural pattern and based on Symfony.
WordPress is a content management system based on PHP and MySQL that is usually used with the MySQL.
Creating a blog using Laravel isn’t difficult but why create something which is already existing and solve our primary purpose? Yes, I’m talking about WordPress. WordPress is trusted and rock-solid as a blogging platform, so let’s just install it alongside our Laravel Web Application.
So one may ask — why do I need to think of adding a blog to a Laravel app? The answer to the question is simple — the benefits of SEO(Search Engine Optimization) & MOZ Rank (Domain Authority)
Who's this for?
If you are one who understands the importance of DA & SEO Scores and wants a blog within your primary domain (ex. madgeek.in
), this article is for you.
Let’s assume you have:
- Web Server
- A Web server running on top of Ubuntu with Apache
- LAMP stack
Step 1: Download A Copy of WordPress
Download the latest copy of WordPress available to a temporary location. When you download the file, it will be in a zipped package. You can download the same in CLI mode using the following command.
curl -O https://wordpress.org/latest.tar.gz
(or)
Not sure how to access server CLI? - For Windows System and for MAC follow my previous video on How to add domain and host websites on DigitalOcean droplet.
If you are not comfortable with the commands, download the zip file and upload it to a temporary location on your web server. Wondering how to upload files to the server? — Check this video.
Step 2: Create a Blog Directory For The WordPress Files
For such Laravel-WordPress integration, we will configure it in such a way that when you visit the Laravel application that currently resides on the root domain, you will be able to append a /blog
to the domain and reach your blog.
Let’s say, your Laravel project domain is https://www.madgeek.in,
we will ensure that blog traffics are pushed to http://madgeek.in/blog
with full support for pretty URLs, administration control and all the other bells and whistles of WordPress without disturbing the existing Laravel application.
This is how to complete the Laravel-WordPress integration.
- Create a blog directory within the public directory of your Laravel Installation
- Place all the WordPress files in the blog directory
- Create a new database on your server to support the new WordPress install
- Update your apache configuration
- Restart the apache service
- Install WordPress
Note: Again, we make a few assumptions for this tutorial. One being that you have your own VPS, and two being that it is a LAMP stack. LAMP is Linux, Apache, MySQL, and PHP.
The index.php
file in the Laravel project public directory is the entry into your Laravel application. You will load the WordPress files into the public/blog
directory so that the index.php
file for WordPress exists in the blog directory. This is the entry into your WordPress blog.
Step 3: Create a database for the WordPress install
If you have a GUI tool such as phpmyadmin
installed, this will be an easy process. If not, follow the video
Step 4: Update Apache Configurations
Change the .htaccess
file located within your WordPress or blog directory, if it does not exist use the following command
nano .htaccess
(or)
touch .htaccess
nano .htaccess
and paste the below configuration in the .htaccess
file
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* -
# Redirect Trailing Slashes If Not A Folder…
# RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} (.+)/$
#RewriteRule ^ %1
# Handle Front Controller…
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php
The below settings will cause your posts infinite redirection, so ensure to comment these out
# Redirect Trailing Slashes If Not A Folder…
# RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} (.+)/$
#RewriteRule ^ %1
Once you have updated the apache configuration file, be sure to restart the apache service using the following command
sudo service apache2 restart
Step 5: Configure wp-config.php
Set up your database configuration for the blog by renaming wp-config-sample.php
it to wp-config.php
and fill in the credentials to connect to the new database you created in step 3.
One can manually change the wp-config.php
file or let the WordPress installer do it for you. If you wish the WordPress installer to create the wp-config.php
file, hit the URL yourdomain.com/blog
A snippet of that configuration file might look a bit like this.
// ** MySQL settings — You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress’);
/** MySQL database username */
define(‘DB_USER’, ‘YOUR-USER-NAME’);
/** MySQL database password */
define(‘DB_PASSWORD’, ‘YOUR-PASSWORD’);
/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);
/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8’);
/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ‘’);
Step 6. Run Through the WordPress Install
With all of the legwork out of the way, you can now point a browser to http://madgeek.in/blog and you will be greeted with the familiar install screen of a WordPress installation. Fill out the fields as needed and submit the data, and you should now have your working blog right alongside your Laravel application on the same domain.
How to add domain & host your websites on DigitalOcean
This article will highlight how to manage your DNS records using DigitalOcean Control Panel and host your websites on DigitalOcean.
Things You Need
- Droplet on DigitalOcean
- A Domain Name.
- IP Address of your DigitalOcean Droplet.
Step 1: Setting up Nameserver
For this tutorial I am using BigRock, you may have bought the domain from some other provider but don’t worry check out this article on how to add nameserver, DigitalOcean has covered almost all domain name provider.
Login to your domain name provider account (For me it’s BigRock).
- Now click on manage domain and select the domain you want to point to DigitalOcean droplet.
- Now search for the option that’s called DNS (Domain Name Server) or just NameServer.
- Select custom DNS and add following three Nameserver.
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
Step 2: Pointing Droplet IP to the domain name
- Now login to your DigitalOcean account
- Select Networking from the navigation menu
- Now in Domain tab, you will see an option to add a domain
- Enter your domain name (ex.
madgeek.in
) and droplet IP in the input box and click on theCreate Record
button.


Now your Domain name setting should look something like the below image.


In the above image, I’ve added extra CNAME
field with text www
which is pointing to flowerdecorator.in
. I did this because I wanted my domain flowerdecorator.in
to redirect to www.flowerdecorator.in
. So in simple words, I redirected non-www
URLs to www
.