If you want to play Terraria online with other users, you have two options. You can use the Host & Play feature in the Terraria client to host your own online game on your device. Other players can then join the world either with or without a password.
From the title screen, go to 'Multiplayer' > 'Join via Steam'. This will open the Steam overlay to the 'Friends' dialog. Find the friend that you wish to play with in the list. Click the triangle drop-down menu beside their name and click 'Join Game'.