How to Connect to Magento 2 using Terminal SSH
Using command lines in Magento 2, you have to connect to Magento 2 Server using Terminal or SSH first. In this post, we will guide you quickly to connect to Magento 2 Server for Windows, Mac OS and Linux (Debian, Ubuntu, Centos …).
Connect to Magento 2 Server in Windows
In Windows, there are few ways to connect to the Magento server such as Putty, WinSCP or Git Preview. Today, I use Putty to connect to the Magento server. Open Putty and type Server IP or host and Port (default: 22).
Then type Username and Password, after succesfully loggin, you can access to your server.
Change direct to Magento root folder:
In this case, our Magento 2 source code placed in
/var/www/magento2, this may be difference from your server.
Connect to Magento 2 Server in Mac OS, Linux (Debian, Ubuntu, Centos)
By Default, Mac OS and Linux has Terminal tool, you can use this to access to remote Magento server.
- Open Termnial
- Syntax to connect to your Magento server
ssh user@host -pPORT
user: Server Username
host: Server IP or Host
-pPORT(Optional): SSH Server Port. E.g Port 22 so it is
I hope this tutorial will be helpful for you. If you have any questions, feel free to leave comments below.
- How to create a simple Hello World module for Magento 2
- Magento 2 Block Template Ultimate Guides
- How to Create Module in Magento 2
- How to Create Controller in Magento 2
- How to create CRUD Models in Magento 2
- View: Layouts, Block and Templates
- Configuration - System.xml
- How To Create Admin Menu In Magento 2
- Admin ACL
Enjoyed the tutorial? Spread it to your friends!