Minecraft isn't a very hardware-intensive game, but if you're hoping to run your own server, there are some key points to take into account. The first bottleneck you're likely to encounter is RAM: You'll generally need about 1GB of RAM for every four to five players who'll be hanging out on your server. Your primary roadblock will be your Internet connection.
Your first stop: CanIHostaMinecraftServer.com. Enter your connection speed and the amount of RAM inside your prospective server machine, and this website will let you know how many players you can expect to support simultaneously. If that number is a bit low, consider renting space on a dedicated Minecraft server--or having fewer friends.
There are many, many server hosts to choose from. A quick Google search will get you started. But before you choose one, you should have a clear idea of how many players you're likely to have on your server, and how much money you're willing to spend.
If you'll be hosting only a few friends, you can run a Minecraft server on your own hardware; the process is fairly simple. If you plan to install your server on a Windows machine, head over to the Minecraft downloads page and grab the executable. If you plan to run the server on a Mac or Linux machine, download the server .jar file from the same page. (Note: If you plan to run this in Ubuntu, use the Windows server download link.)
Whether you're running on Windows or Mac/Linux, dump the file you've downloaded into its own folder, as it creates a few configuration files of its own when running. In Windows, double-click the executable. It'll immediately set to work creating a world and populating it with critters.
The Mac/Linux option requires a bit more legwork. On either platform, first make sure that you have the latest version of Java installed. Macs will handle that task via software update. On Linux, go to Java's download page and grab the appropriate version for your distribution.
Once you've installed the latest version of Java, you'll need to tell the Minecraft server how much memory to allocate to the server. Feel free to skip to the section of this how-to that's appropriate for your system; Windows users can jump straight to "Getting Your Friends In."
In Linux, open the terminal. Instructions may vary by distribution, but you'll probably find it in the Applications menu, under Accessories. Navigate to your Minecraft server folder (cd NAME OF YOUR FOLDER), and type the following command:
java -Xms1024M -Xmx1024M -jar minecraft_server.jar nogui
This will assign 1GB of RAM to your server. If you're using the 32-bit version of Java, 1GB is your limit. If you're using a 64-bit version of Java, you can replace '1024M' with however many megabytes of memory you'd like to assign. For example, specify 2048M to allocate 2GB, 4096M to allocate 4GB, and so on.
If you're on a Mac, open the TextEdit application, and type (or copy and paste) the following lines of code.
cd "$(dirname "$0")"
exec java -Xmx1G -Xms1G -jar minecraft_server.jar
Allocate as much memory as you'd like by changing '1G' to the number of gigabytes you'd like to set aside (2G for 2GB, 4G for 4GB, and so on).
In the Format Menu, select Make Plain Text, save the file as start.command, and move it into your server folder. Your next stop is the Terminal: type chmod a+x, and drag the 'start.command' file directly into the Terminal; this will give the file the appropriate permissions. Finally, double-click start.command, and your server will start up.
Getting your friends in
Everyone who wants to participate must select the Multiplayer option on Minecraft's main menu. From there, players can choose Direct Connect (for a temporary visit) or Add Server (to instruct Minecraft to remember the details). If everyone's on the same network, they can connect simply by typing localhost into the server address bar. If friends want to connect remotely, you'll need to figure out your external IP address. Simply enter "What is my IP address" into Google and you should get see the info you need in a box above the results.
Sharing your single-player world with friends
In your Minecraft server folder, look for the file named 'server.properties' and open it with your favorite text editor. The Minecraft wiki has an exhaustive guide for configuring your server. We'll focus here on getting a world you've been playing on by yourself onto the server you've just created.
The first step is to find the world you created while playing solo. In Windows, click the Start button, and type " %appdata% " (without quotation marks but with spaces fore and aft) and press Enter. The '.minecraft' folder should be right at the top. Your world will be in the Saves folder; copy that folder into the folder that contains your Minecraft server. In the 'server.properties' file, look for the line that reads 'levelname=world' and change 'world' to the name of your own world. The next time you fire your server up, your creation will be there for everyone who has access to your server to play on.