Linux / UNIX minicom Serial Communication Program

Linux comes with many serial text and gui based serial communication programs. My favorite is minicom – friendly menu driven serial communication program.

If you are addicted to DOS / Windows TELIX (a telecommunications program originally written for DOS and was released in 1986), minicom is for you under Linux / UNIX.

minicom Common features / usage

=> Setting up a remote serial console
=> Access a computer / server if the LAN is down
=> Connect to embedded Linux / BSD device via null modem cable
=> Connect to Cisco routers for configuration
=> Connect to dump device i.e. device w/o keyboard and mouse
=> Dialing directory with auto-redial
=> Support for UUCP-style lock files on serial devices
=> Separate script language interpreter
=> Capture to file
=> Multiple users with individual configurations

Let us see how to configure minicom for my Soekris net4801 Single Board Computer / embedded Linux device.

Install minicom

Use apt-get under Debian / Ubuntu Linux, enter:
$ sudo apt-get install minicom
If you are using Red hat Linux (RHEL) / CentOS / Fedora Linux, enter:
# yum install minicom

How do I use minicom?

First, make sure Linux has detected serial ports. Use setserial command to set and/or report the configuration information associated with a serial port.

Setup minicom

The -s option use to setup minicom. Type the following command at shell prompt:
$ minicom -s

(Fig. 01: minicom in configuration mode)
Some terminals such as the Linux console support color with the standard ANSI escape sequences. Type the following command start minicom with colours:
$ minicom -s -c on

(Fig: 02: minicom in configuration mode with color console)
When minicom starts, it first searches the MINICOM environment variable for command-line arguments, which can be over-ridden on the command line. Thus, if you have done:
$ export MINICOM="-m -c on"
Start minicom
$ minicom
minicom will assume that your terminal has a Meta or key and that color is supported. You can add MINICOM variable to your shell startup script such as ~/.bash_profile.

minicom keyboard short cut keys

Use the following keys:

  1. UP arrow-up or k
  2. DOWN arrow-down or j
  3. LEFT arrow-left or h
  4. RIGHT arrow-right or l
  5. CHOOSE (select menu) Enter
  6. CANCEL ESCape

Configure serial port

You need to configure serial port. Use up and down arrows to select menus. Press down and select Serial port setup:

(Fig. 03: Configure serial port with minicom)

  • Press A to setup serial device name such as /dev/ttyS1
  • Press E to setup Bps/Par/Bits
  • Press [ESC] to exit
  • Save setup as DFL
  • Exit

More on shortcut keys

To activate help menu press [CTRL+A] followed by [Z] for help on special keys:

(Fig: 04: minicom command help summary)

minicom in action

You need to connect your serial device such as router or modem using modem cable. Once connected power on device and type minicom command without -s option:
$ minicom -c on

(Fig: 05: minicom connected to one of my embedded Linux device via null modem cable [ click to enlarge image])
The soekris embedded Linux / BSD board with AMD 266 Mhz CPU + 256M RAM. This device connected to my computer using DB9 null modem cable. During the development you need to use minicom to install Linux kernel, format filesystem and configure device.

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
44 comments… add one
  • Nan Lyu Feb 9, 2016 @ 21:50

    And even if when I use ttys1 and it shows online, it hangs after starting minicom and shows nothing. Anybody have a solution?

  • Nan Lyu Feb 9, 2016 @ 21:37

    Hi, I am using minicom for the connection of an altera FPGA board. It uses USB blaster. After configuration, it kept giving me offline when I start ‘minicom’. Any idea how to solve this? Thanks.

    My configuration:
    | A – Serial Device : /dev/ttyS0 |
    | |
    | C – Callin Program : |
    | D – Callout Program : |
    | E – Bps/Par/Bits : 38400 8N1 |
    | F – Hardware Flow Control : Yes |
    | G – Software Flow Control : No

    My computer after dmesg | grep tty:
    [ 0.000000] console [tty0] enabled
    [ 0.517646] 00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [ 0.538158] 0000:00:16.3: ttyS1 at I/O 0xf0e0 (irq = 19) is a 16550A

  • EDUARDO Jan 22, 2015 @ 21:00

    Excelente tutorial

  • Matt Jan 2, 2015 @ 0:15

    When I go to set my ComPort it says “minicom: cannot open /dev/ttyUSB0: Permission denied”

    Am I doing something wrong? I have no 9 Pin Serial ports only a USB to serial port cord.

  • Jorge Cruz Nov 20, 2014 @ 2:59

    No puedo instalar el minicom en mi Fedora 14 me sale el siguiente mensaje: PORFAVOR SU AYUDA:

    [root@Servidor Yorch]# yum install minicom
    Complementos cargados:langpacks, presto, refresh-packagekit
    Adding es_ES to language list
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again

  • arvid May 22, 2013 @ 11:04

    Hi everyone,

    I’m not getting any output from minicom.. I’ve tried shorting pins 2 and 3 without result, and also checked every pin with o-scope while typing or sending files – no response – just a constant +5V. I’m using a prolific USB-to-serial adapter on OS X. I have no problems with input, so I’m pretty sure I’m on the right serial device, just no output..
    I’ve also tried all possible combinations of hardware/software flow control without any luck.

    Any suggestions much appreciated!

    Arvid

  • passing by Jan 14, 2013 @ 17:40

    Don’t bother with minicom unless you need modem functions. Otherwise, you can probably do what you like with a package called “expect” – using the “autoexpect” script. This is a TCL script that allows you to simply type your responses and then gives you an editable script. When combined with bash, you can do a lot.
    Also, have a look at curl and wget.

  • Greg Ennis Sep 6, 2012 @ 20:43

    I am trying to use minicom within a bash script to logon to a remote computer, poll it to see if files for downloading are present, and then download the files and process them accordingly. Can minicom be used without user interaction? Is there a tutorial present pertaining the script language that minicom supports? Thanks much, Greg Ennis

  • yannick Jun 15, 2012 @ 9:52

    I use minicom for modem with smslib. But when i connect, i cannot write the AT’s commands. My linux terminal don’t show me the command AT that i write. Can somedy help me please.

    Thank you

  • Swathi Apr 17, 2012 @ 21:50

    Hello,
    When I tried to configure my minicom using minicom -s, it is displaying dev/modem instead of dev/ttyS0. What does this mean? I need to connect my Embedded Linux board (ARM processor) to one of the ports. Hence I need to configure minicom correctly before doing that. Any help is appreciated.

    Thank you

  • parag dhake Jan 13, 2012 @ 12:02

    hello friends,
    we are doing a project on pci driver.
    our project is write pci driver and use functionality of ARM7 through uart.
    i am done with pci driver, now i want to check our driver for full fledge.
    i have a problem, when i am starting comunication between two pc using db9 connectors, who will first start the communication get full data & another side some data gets lost may be starting data.
    plz tell me that how i will minimizes this problem?
    what will i do in driver?
    i am use platform “linux”………….
    Rgards
    parag
    dhakeparag81@gmail.com

  • rajeev Sep 24, 2011 @ 12:24

    Hi all,
    I had installed minicom in my Linux PC with “Linux localhost.localdomain 2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:55:12 EDT 2007 i686 i686 i386 GNU/Linux” installed. when i run minicom i can watch my unit booting
    Welcome to minicom 2.2

    OPTIONS: I18n
    Compiled on Sep 25 2007, 06:13:56.
    Port /dev/ttyS0

    Press CTRL-A Z for help on special keys

    RomBOOT
    >Start AT91Bootstrap…

    U-Boot 2008.10 (Sep 19 2011 – 17:57:15)

    DRAM: 64 MB
    Initializing Display
    NAND: 256 MiB
    DataFlash:AT45DB642
    Nb pages: 8192
    Page Size: 1056
    Size= 8650752 bytes
    Logical address: 0xD0000000
    Area 0: D0000000 to D00041FF (RO) Bootstrap
    Area 1: D0004200 to D00083FF Environment
    Area 2: D0008400 to D0041FFF (RO) U-Boot
    Area 3: D0042000 to D0251FFF Kernel
    Area 4: D0252000 to D083FFFF FS
    *** Warning – bad CRC, using defaul

    but when i try to type from keyboard i am unable to communicate to minicom
    Distribution built by Analogics Tech Ind Limited,Hyderabad
    Kernel 2.6.28-ATIL-H10 for armv5tejl
    ATIL-H10 login:
    i am unable to type a thing on minicom
    pls help..
    Regards,
    Rajeev

    • prince May 29, 2014 @ 11:02

      Make the setup..
      Hardware flow control : NO
      software flow control: NO

  • robert Apr 17, 2011 @ 17:26

    Update… i have sorted it…. pressed enter and router>

    • robert Apr 17, 2011 @ 17:37

      I think the issue with the saving of the file is still there, but i think that might be down to not being able to get into root to save the file

  • robert Apr 17, 2011 @ 16:48

    I have done of the minicom set up, but when it comes to saving the file it states that i dont have the permissions to save the file as dft. Im not sure if i have to be in root to save the file. Currently using Kubuntu 10.10 at the moment. Trying to set up a Cisco Router.

  • dustin Mar 1, 2011 @ 21:02

    Thanks – the quick tutorial helped a lot

  • gtr Nov 15, 2010 @ 9:25

    Thank you for sharing this information.
    I like to know if we can use minicom to run in different config to different serial ports in one linux box? I have no problem in using minicom to /dev/ttyS0 (build-in). I add 2 more serial (PCI) and detected it as /dev/ttyS1 and /dev/ttyS2. Problem is when I use this 2 serial ports it says “offline”. cables are ok and devices connected to are all active. check it using /dev/ttyS0. Can anyone help me? TIA

    • mr.thinh Mar 14, 2011 @ 18:37

      dear . . .

      I have ttyS0 , ttyS1, ttyS2 . I can see one of them only . How can i connect and use 3 of them at the same time ?

      Thank you .

  • PAgore May 19, 2010 @ 19:20

    Kewl!
    Now i can use my grasshopper (ICnova AP7000 Base) in a colorful terminal! 😀
    $ minicom -c on

    Thank You! 🙂

  • szmarcek Mar 28, 2010 @ 1:01

    My router is linked to the db25 port via a rolled cable and a RJ45 to DB25 adapter and minicom did not work with /dev/ttyS0 or S1 and dmesg with grep ttyS* did not show anything but I noticed /dev/ttyUSB0 entry under /dev/ and when I set minicom to point to /dev/ttyUSB0 everyhting worked fine!

  • Saad Usmani Jan 29, 2010 @ 12:19

    Working perfectly fine. JAY Hoo…

  • tobias Nov 3, 2009 @ 13:35

    pls read some manuals and willingly learn.. “i have trouble please help me very much” is NOT the correct way of asking people to spend their spare time helping you.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.