Answer by taking a quote from the following article:

Cornelius Vanderbilt (May 27, 1794 - January 4, 1877), also known informally as "Commodore Vanderbilt", was an American business magnate and philanthropist who built his wealth in railroads and shipping. Born poor and having only a mediocre education, Vanderbilt used perseverance, intelligence, and luck to work his way into leadership positions in the inland water trade and invest in the rapidly growing railroad industry. He is known for owning the New York Central Railroad. As one of the richest Americans in history and wealthiest figures overall, Vanderbilt was the patriarch of a wealthy, influential family.

After Thomas Gibbons died in 1826, Vanderbilt worked for Gibbons' son William until 1829. Though he had always run his own businesses on the side, he now worked entirely for himself. Step by step, he started lines between New York and the surrounding region. First he took over Gibbons' ferry to New Jersey, then switched to western Long Island Sound. In 1831, he took over his brother Jacob's line to Peekskill, New York, on the lower Hudson River. That year he faced opposition by a steamboat operated by Daniel Drew, who forced Vanderbilt to buy him out. Impressed, Vanderbilt became a secret partner with Drew for the next thirty years, so that the two men would have an incentive to avoid competing with each other. On November 8, 1833, Vanderbilt was nearly killed in the Hightstown rail accident on the Camden and Amboy Railroad in New Jersey. Also on the train was former president John Quincy Adams. In 1834, Vanderbilt competed on the Hudson River against the Hudson River Steamboat Association, a steamboat monopoly between New York City and Albany. Using the name "The People's Line," he used the populist language associated with Democratic president Andrew Jackson to get popular support for his business. At the end of the year, the monopoly paid him a large amount to stop competing, and he switched his operations to Long Island Sound. During the 1830s, textile mills were built in large numbers in New England as the United States developed its manufacturing base. They processed cotton from the Deep South, so were directly tied to the slave societies. Some of the first railroads in the United States were built from Boston to Long Island Sound, to connect with steamboats that ran to New York. By the end of the decade, Vanderbilt dominated the steamboat business on the Sound, and began to take over management of the connecting railroads. In the 1840s, he launched a campaign to take over the most attractive of these lines, the New York, Providence and Boston Railroad, popularly known as the Stonington. By cutting fares on competing lines, Vanderbilt drove down the Stonington stock price, and took over the presidency of the company in 1847. It was the first of the many railroads he would head. During these years, Vanderbilt also operated many other businesses. He bought large amounts of real estate in Manhattan and Staten Island, and took over the Staten Island Ferry in 1838. It was in the 1830s when he was first referred to as "commodore," then the highest rank in the United States Navy. A common nickname for important steamboat entrepreneurs, by the end of the 1840s, only Vanderbilt was referred to by this nickname. CANNOTANSWER

How did he make all his money?

After Thomas Gibbons died in 1826, Vanderbilt worked for Gibbons' son William until 1829.