Home Linux Email Clients How to Install and Use Alpine with Gmail IMAP in Linux

How to Install and Use Alpine with Gmail IMAP in Linux

Email communication will continue to be a significant aspect of most of our lives even beyond the foreseeable future. For an ordinary Linux user, this type of communication is key as they can easily install, configure, and use GUI email clients like Thunderbird to meet their emailing objectives.

On the other hand, there is another type of Linux user; the superuser – This user has perfected the use of the Linux operating system terminal environment to the extent of not needing the graphical user interface (GUI) anymore. Such users spend most of their time on the Linux terminal or command line environment.

In such circumstances, there is no need to keep switching from the Linux terminal to a GUI-powered web interface to check and respond to urgent emails. You only need to master how to install, configure, and use the terminal-based open-source Alpine email client.

Prerequisites

  • Basic familiarity with the Linux operating system’s terminal environment.
  • Access to a functioning Gmail account.

Install Alpine Email Client in Linux

Choose either of the following Alpine installation guides that are applicable to your Linux operating system distribution.

$ sudo apt-get install alpine     [On Debian, Ubuntu and Mint]
$ sudo yum install alpine         [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux]
$ sudo emerge -a sys-apps/alpine  [On Gentoo Linux]
$ sudo pacman -S alpine           [On Arch Linux]
$ sudo zypper install alpine      [On OpenSUSE]    

Getting Started with Alpine Email Client in Linux

From your Linux terminal, key in the following command:

$ alpine

You will be met with an interface similar to the following:

Alpine Linux Email Client
Alpine Linux Email Client

Press [Enter] on your keyboard to proceed.

The succeeding Alpine terminal interface will look similar to the following:

Alpine Email Client Help
Alpine Email Client Help

To interact with either of the showcased Alpine main menu items, use the keyboard arrow keys for navigation and the [Enter] key for selection.

Since Alpine is an email client, it can be set up to interact with a targeted email server of your choice. For this tutorial demo, we chose to use a Gmail SMTP server since almost everyone has or uses a Gmail email account to send and receive mail.

Alpine Mail Setup with Gmail Account

To set it up, navigate to the S SETUP option and hit [Enter] on your keyboard.

Alpine Gmail Setup
Alpine Gmail Setup

Press “L” on your keyboard to access the CollectionLists setup.

Alpine CollectionLists
Alpine CollectionLists

Press [Enter] again.

Alpine Local Folders
Alpine Local Folders

The resulting interface is the one you will be using to edit the SMTP server settings related to the mail server you are using. In this case, we are going to use Gmail SMTP settings. I created a random Gmail email account for this demo. Use a Gmail email id you can access.

Alpine Gmail SMTP Settings
Alpine Gmail SMTP Settings

Make sure you have IMAP enabled by counter-checking with the following Gmail guide.

Enable Gmail IMAP
Enable Gmail IMAP

Also, the less secure app access setting on your Gmail account should be On to grant Alpine the needed access.

Alpine Gmail Access
Alpine Gmail Access

Back on your Alpine FOLDER COLLECTION interface, you only need to populate the Nickname and Server entries:

Alpine Gmail IMAP Settings
Alpine Gmail IMAP Settings

Port 993 forces all mail transfers to be under SSL (Secure Socket Layer). Use Ctrl+X to save your mail server SMTP settings. You will be prompted for the password associated with the email address you used.

Alpine Gmail Password Authentication
Alpine Gmail Password Authentication

From the succeeding prompt, press “Y” to exit and save changes.

Alpine Folder Collection
Alpine Folder Collection

It will lead to the following prompt.

Alpine Gmail Setup Collection List
Alpine Gmail Setup Collection List

Press “E” to exit the setup.

Alpine Sending Mail with Gmail Account

We need to make additional Alpine configurations before we send any mail.

Go back to SETUP and Press “C” to access Alpine configurations.

Alpine Gmail Configuration
Alpine Gmail Configuration

Next, edit SMTP Server (for sending) and Inbox Path with your values.

Alpine Gmail Inbox Path
Alpine Gmail Inbox Path

Press “E” to save and exit the setup configuration.

Quit Alpine and reload it again for these changes to be effective.

$ alpine
Alpine Gmail Inbox Access
Alpine Gmail Inbox Access

Alpine now has access to your mail’s inbox messages.

If you access FOLDER LIST you should be able to view all the inbox items on your mail account.

Alpine FOLDER LIST
Alpine FOLDER LIST
Alpine Gmail Mail Access
Alpine Gmail Mail Access

Alpine Compose Mail from Gmail Account

Let us now try to compose a message from the Gmail email id we used in this tutorial.

Alpine Gmail Mail Compose
Alpine Gmail Mail Compose
Alpine Sending Mail with Gmail
Alpine Sending Mail with Gmail

Use Ctrl+X to send the email and confirm with “Y” that you want to send it.

Alpine Gmail Mail Sent
Alpine Gmail Mail Sent

The email message arrived as expected.

Mail from Alpine
Mail from Alpine

I can even reply back to it.

Mail Replay to Alpine
Mail Replay to Alpine

And access the reply from the Alpine terminal interface.

Access Gmail Mail from Alpine
Access Gmail Mail from Alpine

With this tutorial, you can comfortably use the Alpine email client with any mail server as long as you configure it with the correct SMTP mail server settings for sending and receiving email. It is now possible to make your Linux terminal environment your emailing environment too.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

3 thoughts on “How to Install and Use Alpine with Gmail IMAP in Linux”

  1. and for those of us who use a non-free service, this is pretty much a repeat of what hasn’t worked.

    I have copied exactly what is on my Kubuntu 16.04 to my 20.04 (soon to be 22.04) works perfectly on 16 but I get an inbox error on 20.04.

    I have been using Pine then later Alpine for many years and don’t want to give it up not to mention lose all of my saved messages. The e-mail provider can’t seem to understand why it will work on 16 but not 20 any help would be appreciated I have been forced to use my laptop for my email for almost a year.

    thanks
    Bob

    Reply
  2. A very good written tutorial.

    I have a question: how to configure an imap yahoo in the alpine. Is it possible? Yahoo is using Oauth2.

    Reply

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.